Accounts Receivable and Accounts Payable is always a problem when an individual or another independent buys another community pharmacy. Unfortunately their is no simple way to deal with them. First in an asset sale (which most sales are) the buyer will be operating on a power of attorney under your licenses. As such they will be billing under your insurance contracts and you will receive their payments. After the sale you will also receive credit card deposits, there will be pro rated bills like the pharmacy system and utilities.
So how do you keep track of all this?
Well the best way is to setup a shared Accounts Receivable / Accounts Payable document (i.e. Google Sheet) shared between all parties. For insurance company payments received before closing, these go to you the seller and payments after closing go to the buyer. You can use 835s to determine what date the prescription was filled. For accounts payable the same holds true, bills are pro-rated based on the closing date. You are responsible for anything up to closing and the buyer is responsible for anything after. Record all of this on the google sheet and settle up once a week.
We would recommend you outline this in the purchase agreement so there is no confusion after closing.