Label both the cost boundary and denominator. Cost per harvested kilogram measures production; cost per sold kilogram also reflects unsold and rejected product. Payment collection is a separate cash-flow measure.
Keep harvested, saleable, sold and rejected quantities distinct, and record invoices and collections separately. A buyer paying late changes working-capital needs, not the number of kilograms that were grown.

