<?php

	// Perform Login
    $SHORTCODE_STATUS = PHPCUS_SHORTCODE::CUS_QUICK_LOGIN();
	
	// Check Array Input
	PHPCUS_PARAM::CUS_DOES_NOT_SUPPORT_ARRAY();
	
	// Check already authenticated
	PHPCUS_PARAM::CUS_REQUIRES_AUTHENTICATION();
	// Check access rights
	PHPCUS_PARAM::CUS_HAS_PERMISSION(PHPCUS_SYSTEM::AUTHORITY_VIEW_ONLY, 'record_eod_zreading');
	
	if
	(
		PHPRC_HTTP_PARAM::REF_ISSET_IN_ARRAY
		(
			[
					'PARAM_REC_EODREP_ZREAD_ID',
					'PARAM_REC_EODREP_ZREAD_REC_EODREP_ID',
					'PARAM_REC_EODREP_ZREAD_CODE',
					'PARAM_REC_EODREP_ZREAD_DATE_FROM',
					'PARAM_REC_EODREP_ZREAD_DATE_TO',
					'PARAM_REC_EODREP_ZREAD_AMOUNT_LAST_FROM',
					'PARAM_REC_EODREP_ZREAD_AMOUNT_LAST_TO',
					'PARAM_REC_EODREP_ZREAD_AMOUNT_ACCUM_FROM',
					'PARAM_REC_EODREP_ZREAD_AMOUNT_ACCUM_TO',
					'PARAM_REC_EODREP_ZREAD_AMOUNT_RESET_FROM',
					'PARAM_REC_EODREP_ZREAD_AMOUNT_RESET_TO',
					'PARAM_REC_EODREP_ZREAD_SALE_TRANSACTION_FROM',
					'PARAM_REC_EODREP_ZREAD_SALE_TRANSACTION_TO',
					'PARAM_REC_EODREP_ZREAD_CANCEL_TRANSACTION_FROM',
					'PARAM_REC_EODREP_ZREAD_CANCEL_TRANSACTION_TO',
					'PARAM_REC_EODREP_ZREAD_CANCEL_ITEM_FROM',
					'PARAM_REC_EODREP_ZREAD_CANCEL_ITEM_TO',
					'PARAM_REC_EODREP_ZREAD_SALE_SUBTOTAL_FROM',
					'PARAM_REC_EODREP_ZREAD_SALE_SUBTOTAL_TO',
					'PARAM_REC_EODREP_ZREAD_SALE_DISCOUNT_FROM',
					'PARAM_REC_EODREP_ZREAD_SALE_DISCOUNT_TO',
					'PARAM_REC_EODREP_ZREAD_SALE_RETURN_FROM',
					'PARAM_REC_EODREP_ZREAD_SALE_RETURN_TO',
					'PARAM_REC_EODREP_ZREAD_SALE_VATABLE_FROM',
					'PARAM_REC_EODREP_ZREAD_SALE_VATABLE_TO',
					'PARAM_REC_EODREP_ZREAD_SALE_VATEXEMPT_FROM',
					'PARAM_REC_EODREP_ZREAD_SALE_VATEXEMPT_TO',
					'PARAM_REC_EODREP_ZREAD_SALE_NONVAT_FROM',
					'PARAM_REC_EODREP_ZREAD_SALE_NONVAT_TO',
					'PARAM_REC_EODREP_ZREAD_SALE_ZERORATED_FROM',
					'PARAM_REC_EODREP_ZREAD_SALE_ZERORATED_TO',
					'PARAM_REC_EODREP_ZREAD_SALE_VAT_FROM',
					'PARAM_REC_EODREP_ZREAD_SALE_VAT_TO',
					'PARAM_REC_EODREP_ZREAD_PAID_CASH_FROM',
					'PARAM_REC_EODREP_ZREAD_PAID_CASH_TO',
					'PARAM_REC_EODREP_ZREAD_PAID_CARD_FROM',
					'PARAM_REC_EODREP_ZREAD_PAID_CARD_TO',
					'PARAM_REC_EODREP_ZREAD_PAID_CHECK_FROM',
					'PARAM_REC_EODREP_ZREAD_PAID_CHECK_TO',
					'PARAM_REC_EODREP_ZREAD_PAID_BANK_FROM',
					'PARAM_REC_EODREP_ZREAD_PAID_BANK_TO',
					'PARAM_REC_EODREP_ZREAD_PAID_LOYALTY_FROM',
					'PARAM_REC_EODREP_ZREAD_PAID_LOYALTY_TO',
					'PARAM_REC_EODREP_ZREAD_PAID_VOUCHER_FROM',
					'PARAM_REC_EODREP_ZREAD_PAID_VOUCHER_TO',
					'PARAM_REC_EODREP_ZREAD_PAID_OTHER_FROM',
					'PARAM_REC_EODREP_ZREAD_PAID_OTHER_TO',
					'PARAM_REC_EODREP_ZREAD_STATUS',
					
					'PARAM_ORDER_FIELD',
					'PARAM_ORDER_TYPE',
					'PARAM_SKIP',
					'PARAM_LIMIT'
			], True
		)
	)
	{
		Try
		{
			// Read params
			// ------------------------------------------------------------------	
			$PARAM_REC_EODREP_ZREAD_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_EODREP_ZREAD_ID');
			$PARAM_REC_EODREP_ZREAD_REC_EODREP_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_EODREP_ZREAD_REC_EODREP_ID');
			$PARAM_REC_EODREP_ZREAD_CODE = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_EODREP_ZREAD_CODE');
			$PARAM_REC_EODREP_ZREAD_DATE_FROM = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_EODREP_ZREAD_DATE_FROM');
			$PARAM_REC_EODREP_ZREAD_DATE_TO = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_EODREP_ZREAD_DATE_TO');
			$PARAM_REC_EODREP_ZREAD_AMOUNT_LAST_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_AMOUNT_LAST_FROM');
			$PARAM_REC_EODREP_ZREAD_AMOUNT_LAST_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_AMOUNT_LAST_TO');
			$PARAM_REC_EODREP_ZREAD_AMOUNT_ACCUM_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_AMOUNT_ACCUM_FROM');
			$PARAM_REC_EODREP_ZREAD_AMOUNT_ACCUM_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_AMOUNT_ACCUM_TO');
			$PARAM_REC_EODREP_ZREAD_AMOUNT_RESET_FROM = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_EODREP_ZREAD_AMOUNT_RESET_FROM');
			$PARAM_REC_EODREP_ZREAD_AMOUNT_RESET_TO = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_EODREP_ZREAD_AMOUNT_RESET_TO');
			$PARAM_REC_EODREP_ZREAD_SALE_TRANSACTION_FROM = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_EODREP_ZREAD_SALE_TRANSACTION_FROM');
			$PARAM_REC_EODREP_ZREAD_SALE_TRANSACTION_TO = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_EODREP_ZREAD_SALE_TRANSACTION_TO');
			$PARAM_REC_EODREP_ZREAD_CANCEL_TRANSACTION_FROM = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_EODREP_ZREAD_CANCEL_TRANSACTION_FROM');
			$PARAM_REC_EODREP_ZREAD_CANCEL_TRANSACTION_TO = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_EODREP_ZREAD_CANCEL_TRANSACTION_TO');
			$PARAM_REC_EODREP_ZREAD_CANCEL_ITEM_FROM = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_EODREP_ZREAD_CANCEL_ITEM_FROM');
			$PARAM_REC_EODREP_ZREAD_CANCEL_ITEM_TO = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_EODREP_ZREAD_CANCEL_ITEM_TO');
			$PARAM_REC_EODREP_ZREAD_SALE_SUBTOTAL_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_SUBTOTAL_FROM');
			$PARAM_REC_EODREP_ZREAD_SALE_SUBTOTAL_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_SUBTOTAL_TO');
			$PARAM_REC_EODREP_ZREAD_SALE_DISCOUNT_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_DISCOUNT_FROM');
			$PARAM_REC_EODREP_ZREAD_SALE_DISCOUNT_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_DISCOUNT_TO');
			$PARAM_REC_EODREP_ZREAD_SALE_RETURN_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_RETURN_FROM');
			$PARAM_REC_EODREP_ZREAD_SALE_RETURN_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_RETURN_TO');
			$PARAM_REC_EODREP_ZREAD_SALE_VATABLE_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_VATABLE_FROM');
			$PARAM_REC_EODREP_ZREAD_SALE_VATABLE_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_VATABLE_TO');
			$PARAM_REC_EODREP_ZREAD_SALE_VATEXEMPT_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_VATEXEMPT_FROM');
			$PARAM_REC_EODREP_ZREAD_SALE_VATEXEMPT_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_VATEXEMPT_TO');
			$PARAM_REC_EODREP_ZREAD_SALE_NONVAT_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_NONVAT_FROM');
			$PARAM_REC_EODREP_ZREAD_SALE_NONVAT_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_NONVAT_TO');
			$PARAM_REC_EODREP_ZREAD_SALE_ZERORATED_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_ZERORATED_FROM');
			$PARAM_REC_EODREP_ZREAD_SALE_ZERORATED_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_ZERORATED_TO');
			$PARAM_REC_EODREP_ZREAD_SALE_VAT_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_VAT_FROM');
			$PARAM_REC_EODREP_ZREAD_SALE_VAT_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_SALE_VAT_TO');
			$PARAM_REC_EODREP_ZREAD_PAID_CASH_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_CASH_FROM');
			$PARAM_REC_EODREP_ZREAD_PAID_CASH_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_CASH_TO');
			$PARAM_REC_EODREP_ZREAD_PAID_CARD_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_CARD_FROM');
			$PARAM_REC_EODREP_ZREAD_PAID_CARD_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_CARD_TO');
			$PARAM_REC_EODREP_ZREAD_PAID_CHECK_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_CHECK_FROM');
			$PARAM_REC_EODREP_ZREAD_PAID_CHECK_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_CHECK_TO');
			$PARAM_REC_EODREP_ZREAD_PAID_BANK_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_BANK_FROM');
			$PARAM_REC_EODREP_ZREAD_PAID_BANK_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_BANK_TO');
			$PARAM_REC_EODREP_ZREAD_PAID_LOYALTY_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_LOYALTY_FROM');
			$PARAM_REC_EODREP_ZREAD_PAID_LOYALTY_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_LOYALTY_TO');
			$PARAM_REC_EODREP_ZREAD_PAID_VOUCHER_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_VOUCHER_FROM');
			$PARAM_REC_EODREP_ZREAD_PAID_VOUCHER_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_VOUCHER_TO');
			$PARAM_REC_EODREP_ZREAD_PAID_OTHER_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_OTHER_FROM');
			$PARAM_REC_EODREP_ZREAD_PAID_OTHER_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_EODREP_ZREAD_PAID_OTHER_TO');
			$PARAM_REC_EODREP_ZREAD_STATUS = PHPCUS_PARAM::CUS_READ_INT('PARAM_REC_EODREP_ZREAD_STATUS');
			
			$PARAM_ORDER_FIELD = PHPCUS_PARAM::CUS_READ_SORT_FIELD
			(
					'PARAM_ORDER_FIELD',
					[
						'REC_EODREP_ZREAD_ID', 
						'REC_EODREP_ZREAD_REC_EODREP_ID', 
						'REC_EODREP_ZREAD_CODE', 
						'REC_EODREP_ZREAD_DATE', 
						'REC_EODREP_ZREAD_AMOUNT_LAST', 
						'REC_EODREP_ZREAD_AMOUNT_ACCUM', 
						'REC_EODREP_ZREAD_AMOUNT_RESET', 
						'REC_EODREP_ZREAD_SALE_TRANSACTION', 
						'REC_EODREP_ZREAD_CANCEL_TRANSACTION', 
						'REC_EODREP_ZREAD_CANCEL_ITEM', 
						'REC_EODREP_ZREAD_SALE_SUBTOTAL', 
						'REC_EODREP_ZREAD_SALE_DISCOUNT', 
						'REC_EODREP_ZREAD_SALE_RETURN', 
						'REC_EODREP_ZREAD_SALE_VATABLE', 
						'REC_EODREP_ZREAD_SALE_VATEXEMPT', 
						'REC_EODREP_ZREAD_SALE_NONVAT', 
						'REC_EODREP_ZREAD_SALE_ZERORATED', 
						'REC_EODREP_ZREAD_SALE_VAT', 
						'REC_EODREP_ZREAD_PAID_CASH', 
						'REC_EODREP_ZREAD_PAID_CARD', 
						'REC_EODREP_ZREAD_PAID_CHECK', 
						'REC_EODREP_ZREAD_PAID_BANK', 
						'REC_EODREP_ZREAD_PAID_LOYALTY', 
						'REC_EODREP_ZREAD_PAID_VOUCHER', 
						'REC_EODREP_ZREAD_PAID_OTHER', 
						'REC_EODREP_ZREAD_STATUS'
						, 
						'REC_EODREP_ID',		
						'REC_EODREP_ACC_GROUP_ID',		
						'REC_EODREP_REC_POSDEVICE_ID',		
						'REC_EODREP_ACC_ACCOUNT_ID',		
						'REC_EODREP_TIME_CLOSED',		
						'REC_EODREP_SALE_TRANSACTION',		
						'REC_EODREP_CANCEL_TRANSACTION',		
						'REC_EODREP_CANCEL_ITEM',		
						'REC_EODREP_SALE_SUBTOTAL',		
						'REC_EODREP_SALE_DISCOUNT',		
						'REC_EODREP_SALE_VATABLE',		
						'REC_EODREP_SALE_VATEXEMPT',		
						'REC_EODREP_SALE_NONVAT',		
						'REC_EODREP_SALE_ZERORATED',		
						'REC_EODREP_SALE_VAT',		
						'REC_EODREP_SALE_VAT_LESS',		
						'REC_EODREP_SALE_POINT',		
						'REC_EODREP_STATUS'		
					]
			);		
			$PARAM_ORDER_TYPE = PHPCUS_PARAM::CUS_READ_SORT_TYPE('PARAM_ORDER_TYPE');
			$PARAM_SKIP	= PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_SKIP');
			$PARAM_LIMIT = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_LIMIT');
			
			// ------------------------------------------------------------------
			
			
			// Populate Map Array
			// ...........................................
			$GET_MAP_ARRAY = PHPCUS_RECORD_EOD_ZREADING::CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
			
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_ID'] = $PARAM_REC_EODREP_ZREAD_ID;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_REC_EODREP_ID'] = $PARAM_REC_EODREP_ZREAD_REC_EODREP_ID;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_CODE'] = $PARAM_REC_EODREP_ZREAD_CODE;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_DATE_FROM'] = $PARAM_REC_EODREP_ZREAD_DATE_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_DATE_TO'] = $PARAM_REC_EODREP_ZREAD_DATE_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_AMOUNT_LAST_FROM'] = $PARAM_REC_EODREP_ZREAD_AMOUNT_LAST_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_AMOUNT_LAST_TO'] = $PARAM_REC_EODREP_ZREAD_AMOUNT_LAST_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_AMOUNT_ACCUM_FROM'] = $PARAM_REC_EODREP_ZREAD_AMOUNT_ACCUM_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_AMOUNT_ACCUM_TO'] = $PARAM_REC_EODREP_ZREAD_AMOUNT_ACCUM_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_AMOUNT_RESET_FROM'] = $PARAM_REC_EODREP_ZREAD_AMOUNT_RESET_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_AMOUNT_RESET_TO'] = $PARAM_REC_EODREP_ZREAD_AMOUNT_RESET_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_TRANSACTION_FROM'] = $PARAM_REC_EODREP_ZREAD_SALE_TRANSACTION_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_TRANSACTION_TO'] = $PARAM_REC_EODREP_ZREAD_SALE_TRANSACTION_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_CANCEL_TRANSACTION_FROM'] = $PARAM_REC_EODREP_ZREAD_CANCEL_TRANSACTION_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_CANCEL_TRANSACTION_TO'] = $PARAM_REC_EODREP_ZREAD_CANCEL_TRANSACTION_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_CANCEL_ITEM_FROM'] = $PARAM_REC_EODREP_ZREAD_CANCEL_ITEM_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_CANCEL_ITEM_TO'] = $PARAM_REC_EODREP_ZREAD_CANCEL_ITEM_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_SUBTOTAL_FROM'] = $PARAM_REC_EODREP_ZREAD_SALE_SUBTOTAL_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_SUBTOTAL_TO'] = $PARAM_REC_EODREP_ZREAD_SALE_SUBTOTAL_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_DISCOUNT_FROM'] = $PARAM_REC_EODREP_ZREAD_SALE_DISCOUNT_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_DISCOUNT_TO'] = $PARAM_REC_EODREP_ZREAD_SALE_DISCOUNT_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_RETURN_FROM'] = $PARAM_REC_EODREP_ZREAD_SALE_RETURN_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_RETURN_TO'] = $PARAM_REC_EODREP_ZREAD_SALE_RETURN_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_VATABLE_FROM'] = $PARAM_REC_EODREP_ZREAD_SALE_VATABLE_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_VATABLE_TO'] = $PARAM_REC_EODREP_ZREAD_SALE_VATABLE_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_VATEXEMPT_FROM'] = $PARAM_REC_EODREP_ZREAD_SALE_VATEXEMPT_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_VATEXEMPT_TO'] = $PARAM_REC_EODREP_ZREAD_SALE_VATEXEMPT_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_NONVAT_FROM'] = $PARAM_REC_EODREP_ZREAD_SALE_NONVAT_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_NONVAT_TO'] = $PARAM_REC_EODREP_ZREAD_SALE_NONVAT_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_ZERORATED_FROM'] = $PARAM_REC_EODREP_ZREAD_SALE_ZERORATED_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_ZERORATED_TO'] = $PARAM_REC_EODREP_ZREAD_SALE_ZERORATED_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_VAT_FROM'] = $PARAM_REC_EODREP_ZREAD_SALE_VAT_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_SALE_VAT_TO'] = $PARAM_REC_EODREP_ZREAD_SALE_VAT_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_CASH_FROM'] = $PARAM_REC_EODREP_ZREAD_PAID_CASH_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_CASH_TO'] = $PARAM_REC_EODREP_ZREAD_PAID_CASH_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_CARD_FROM'] = $PARAM_REC_EODREP_ZREAD_PAID_CARD_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_CARD_TO'] = $PARAM_REC_EODREP_ZREAD_PAID_CARD_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_CHECK_FROM'] = $PARAM_REC_EODREP_ZREAD_PAID_CHECK_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_CHECK_TO'] = $PARAM_REC_EODREP_ZREAD_PAID_CHECK_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_BANK_FROM'] = $PARAM_REC_EODREP_ZREAD_PAID_BANK_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_BANK_TO'] = $PARAM_REC_EODREP_ZREAD_PAID_BANK_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_LOYALTY_FROM'] = $PARAM_REC_EODREP_ZREAD_PAID_LOYALTY_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_LOYALTY_TO'] = $PARAM_REC_EODREP_ZREAD_PAID_LOYALTY_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_VOUCHER_FROM'] = $PARAM_REC_EODREP_ZREAD_PAID_VOUCHER_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_VOUCHER_TO'] = $PARAM_REC_EODREP_ZREAD_PAID_VOUCHER_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_OTHER_FROM'] = $PARAM_REC_EODREP_ZREAD_PAID_OTHER_FROM;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_PAID_OTHER_TO'] = $PARAM_REC_EODREP_ZREAD_PAID_OTHER_TO;
			$GET_MAP_ARRAY['PARAM_REC_EODREP_ZREAD_STATUS'] = $PARAM_REC_EODREP_ZREAD_STATUS;
			
			$GET_MAP_ARRAY["PARAM_ORDER_FIELD"] = $PARAM_ORDER_FIELD;
			$GET_MAP_ARRAY["PARAM_ORDER_TYPE"] = $PARAM_ORDER_TYPE;
			$GET_MAP_ARRAY["PARAM_SKIP"] = $PARAM_SKIP;
			$GET_MAP_ARRAY["PARAM_LIMIT"] = $PARAM_LIMIT;
			
			
			// Execute Stored Procedure
			// ...........................................
			$DATA_SET = PHPCUS_RECORD_EOD_ZREADING::CUS_GET_MA($GET_MAP_ARRAY);
			
						
			// Return JSON response
			// ...........................................
			if(empty($DATA_SET) === False)
			{
				PHPCUS_PARAM::CUS_JSON_SUCCESS($DATA_SET);
			}
			else
			{
				PHPCUS_PARAM::CUS_JSON_SUCCESS('');
			}
			
		}
		Catch(Exception $ERR)
		{		
			PHPVC_LOG::VAR_REPORT_ERROR($ERR, 0);
			if(isset($_SERVER['HTTP_ORIGIN']))
			{
			    PHPVC_LOG::VAR_ERROR('HTTP_ORIGIN', $_SERVER['HTTP_ORIGIN']);
			}
			if(isset($_SERVER['HTTP_HOST']))
			{
			    PHPVC_LOG::VAR_ERROR('HTTP_HOST', $_SERVER['HTTP_HOST']);
			}		
			if(isset($_SERVER['HTTP_REFERER']))
			{
			    PHPVC_LOG::VAR_ERROR('HTTP_REFERER', $_SERVER['HTTP_REFERER']);
			}
			if(isset($_SERVER['REMOTE_ADDR']))
			{
			    PHPVC_LOG::VAR_ERROR('REMOTE_ADDR', $_SERVER['REMOTE_ADDR']);
			}
			
			PHPCUS_PARAM::CUS_JSON_ERROR($ERR->getMessage());
		}
	}
	else
	{
		PHPCUS_PARAM::CUS_JSON_ERROR('Missing parameters');
	}

?>