<?php

namespace Modules\Invoices\Payments\Management\TransferToCredit\Config;

class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract
{

	/**
	 * (non-PHPdoc)
	 * @see \App\Mvc\View_Utils_FormAbstract::getForm()
	 */
	public function getForm()
	{

		$form = \Engine\Form\General::create();

		// PAYMENT DOCUMENT DETAILS
		$paymentDocDetails = \Engine\Form\Container\Fieldset::create($this->lang['index']['form']['fieldset']['paymentDocDetails']);
		$form->addContainer($paymentDocDetails);

		// payment type
		$payDocType = new \App\Form\Input\Select_PaymentDocType($this->lang['index']['form']['paymentDocType'], 'paymentDocType', $this->values['paymentDocType']);
		$payDocType->showDefaultOption();
		$payDocType->setMandatory();
		$paymentDocDetails->addElement($payDocType);

		// IMPORTED DOCUMENT DETAILS
		$impDocFieldset = \Engine\Form\Container\Fieldset::create($this->lang['index']['form']['fieldset']['impDocDetails']);
		$form->addContainer($impDocFieldset);

		// external system code
		$fld = new \App\Form\Input\Select_DocumentExternalSystem($this->lang['index']['form']['externalSystemCode'], 'idExternalSystem', $this->values['idExternalSystem']);
		$fld->setMandatory();
		$fld->showDefaultOption();
		$impDocFieldset->addElement($fld);

		// document type
		$payDocType = new \App\Form\Input\Select_PaymentDocType($this->lang['index']['form']['impDocType'], 'impDocType', $this->values['impDocType']);
		$payDocType->showDefaultOption();
		$payDocType->setMandatory();
		$impDocFieldset->addElement($payDocType);

		$form->addElement(new \Engine\Form\Input\Hidden('', $this->submitButtonName, 1));

		return $form;
	}


}