Invoice Item Charge Calculation

Invoice Item Charge Calculation

My company provides medical billing services to medical practices and normally invoices for a share of the "total collected revenue" from the previous month.  Example:  Medical practice had gross receipts in a month of $100K.  Our agreed upon rate is 5%.  Therefore, on the first of each month a client will receive an invoice for 5% of collected revenue, or $5K.  If I create custom fields for total collected revenue for the previous period and another custom field for the perce, (5%), can I put both of those custom field into an invoice line item to calculate the fee we will be charging the practice?  Example: Rather than using QTY, and placing the revenue number in there and using a percentage rather than static charge? If I can, is there a way to put the fee percentage there as well?  (Example: revenue=$100K and the rate=5%)  Total revenue share would total $5K for the month.  Can I edit layout/fields to accomplish this, or should I just attach a spreadsheet with all the calculations, manually insert the charge amount, and attach it to the invoice for anyone wanting to review each transaction?