<?php
namespace Modules\Invoices\Cashings\Management;

use \App\Mvc\View\Utils\Types\ListingColumn;
use \App\Mvc\View\Utils\Types\ListingColumns;

class View_List extends \App\Mvc\View_Popup_PaginatedListing_ListAbstract
{
	/**
	 * Results per page list
	 * @see \App\Mvc\\App\Mvc\View_Window_PaginatedListing_ListAbstract::$resultsPerPageList
	 */
	protected $resultsPerPageList = [PHP_INT_MAX];

	/**
	 * 
	 * {@inheritDoc}
	 * @see \App\Mvc\View_Popup_PaginatedListing_ListAbstract::createListingObj()
	 */
	protected function createListingObj()
	{
		$listingObject = \Theme::getInstance()->listing()->createListingObj();
		$listingObject->setContainerTemplate('listingIndex.tpl');

		return $listingObject;
	}

	/**
	 * (non-PHPdoc)
	 * @see \App\Mvc\\App\Mvc\View_Window_PaginatedListing_ListAbstract::list_getThDetails()
	 */
	protected function list_getThDetails()
	{
		return ListingColumns::create()

			->append(
				ListingColumn::create('docType')
			)
			->append(
				ListingColumn::create('docNumber')
			)
			->append(
				ListingColumn::create('docDate')
					->setType('date')
			)
			->append(
				ListingColumn::create('value')
			)
			->append(
				ListingColumn::create('idBankAccount')
			)
			->append(
				ListingColumn::create('addTime')
					->setType('date')
					//->setSortable('ASC')
			)
			->append(
				ListingColumn::create('issueTime')
			)
			->append(
				ListingColumn::create('blockTime')
			)
			->append(
				ListingColumn::create('voidTime')
			)

		->loadLabels($this->lang['index']['listingColumns'])
		->loadSettings($this->input['listingParams']->getDynamicColumnsSettings());
	}

}
