Landed Cost Voucher using CBM

A very common scenario is that tansportation expenses are distributed based on CBM.

How to account for that?

I have devised following plan:

Add fields: length, width, height, cbm, tcbm to all relevent documents like item, purchase order, purchase recipt, purchase invoice, sales docs etc.

write a script to take into account tcbm and distribute the expenses.

Any ideas / suggesions?

Does already such a modul exists?

Also how can we reflect following scenario:

  1. We have induvidual products
  2. They can be put into cartons
  3. Cartons can be s, m & L like 30 pcs, 60 pcs & 120 pcs
  4. we can use UOM in item document to define item & cartons
  5. Can we attach dimensions to cartons to calculate cbm
  6. Can we use this cbm to calculate distribution of shipping and other costs to product purchased.
  7. can we use a combination of cbm and weight to distribute shipping costs?

Thank you for suggesions