How would you implement a "punch card"?

Here is my scenario. I have many items defined in SuiteCRM in the “Products” AOS_Products module. One of these items is a product that is a pre-purchased 10 items. For example. We sell Widgets at $10 each. Buy the 10 pack for $95 and you get 10 Widgets to use at a FUTURE date. In AOS_Products we have the Widget as a record and the Widget 10-pack as a record. I need to be able to keep track of which individual Widgets get used in a purchased 10-pack.

I have my ideas, but I’d like to quiz the forum on how YOU would implement this tracking.

Best idea wins a beer from me. :slight_smile:

(I don’t drink alcohol, so your offer is mute with me, regardless. :whistle: )

Off the top of my head and not ideal … assign a secondary SKU (valued at $0) for each widget that can be bought as part of a 10-pack and as customers draw on their pre-paids, enter a transaction using the zero-valued SKU.

This is something that SuiteCRM is not going to be able to handle outright, so you are looking at some backend processing.

You need a middle table to handle your scenario. Check out the aos_products_quotes table.

For this you can add MetaData file at custom/metadata/products_packMetaData.php and define the table columns.
Handle the view and processing separately as field type of “function” something like below as vardef

 products_packs = array(
 			'required' => false,
			'name' => 'products_packs',
			'type' => 'function',
			'source' => 'non-db',
			'function' => 
				array (
				  'name' => 'display_products_packs',
				  'returns' => 'html',
				  'include' => 'custom/modules/AOS_Quotes/products_packs.php'
				),
			);