

	// ===============================================================
	// Trims empty spaces and perform convertion for numeric fields.
	// ===============================================================
	function SAMPLE_SAVE()
	{
		// Save item [Prepare]
		// _______________________________________________________________________
		var SAVE_MAP_ARRAY = JSCUS_SQL._RECORD._POS_SALE_LIST.CUS_PREPARE_MAPPED_ARRAY_FOR_PURCHASE();
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_REC_CLIENT_ID", 1);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_REC_LOYALTY_ID", 1);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_CODE", '000000001');
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_DATE_DUE", '1000-01-01');
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_REMARKS", '');
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_ACC_ACCOUNT_ID", 1);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_DATE_TRANSACT", '2021-02-27');
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_STATUS", 2);
		
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_CAT_PRODUCT_ID", 2);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_CAT_UOM_ID", 1);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_AMOUNT_PRICE", 2);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_AMOUNT_VAT", 0);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_QUANTITY", 125);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_QUANTITY_PCS", 1);
		
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_CAT_DISCOUNT_ID", 2);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_TOPAY_SUBTOTAL", 250);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_TOPAY_DISCOUNT", 1);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_TOPAY_VATABLE", 223.21);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_TOPAY_VATEXEMPT", 0);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_TOPAY_NONVAT", 0);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_TOPAY_ZERORATED", 0);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_TOPAY_VATOTHER", 0);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_TOPAY_VAT", 26.79);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_POSSALE_LIST_TOPAY_VAT_LESS", 0);	
		
		JSCUS_SQL._RECORD._POS_SALE_LIST.CUS_PURCHASE
		(
			SAVE_MAP_ARRAY,
			function(IS_SUCCESS, HTTP_RESPONSE)
			{
				console.log(HTTP_RESPONSE);
			}
		);
		
				
		// e.g. [2] If you send more items (up to 30 rows) in single request
		/*
			// Initialize
			BUNDLE_MAP_ARRAY = [];
						
			// Populate Row
			while()
			{
				SAVE_MAP_ARRAY = JSCUS_SQL._RECORD._POS_SALE_LIST.CUS_PREPARE_MAPPED_ARRAY_FOR_PURCHASE();
				
				...
				
				BUNDLE_MAP_ARRAY = JSCUS_SQL._RECORD._POS_SALE_LIST.CUS_ADD_MAPPED_ARRAY_FOR_PURCHASE(BUNDLE_MAP_ARRAY, SAVE_MAP_ARRAY);
			}
			
			// Save Request
			JSCUS_SQL._RECORD._POS_SALE_LIST.CUS_PURCHASE
			(
				BUNDLE_MAP_ARRAY,
				function(IS_SUCCESS, HTTP_RESPONSE)
				{
					console.log(HTTP_RESPONSE);
				}
			);
			
		*/

	}

		
SAMPLE_SAVE();