<?php 
require_once 'include/ECM/EcmDocumentNumberGenerator/EcmDocumentNumberGenerator.inc.php';

class EcmDocumentNumberGeneratorController {
	public function getNumberTemplate($module) {
		$dng = new EcmDocumentNumberGenerator($module);
		return array ($dng->getNumberTemplate());
	}
	public function getNormalNumber($module, $stock_id) {
		$dng = new EcmDocumentNumberGenerator($module);
		if ($stock_id)
			$dng->setStock($stock_id);
		$template = $dng->getNumberTemplate();
		return array ($dng->parseNormalNumber($template));
	}
	
	public function getCorrectNumber($module, $stock_id) {
		$dng = new EcmDocumentNumberGenerator($module);
		if ($stock_id)
			$dng->setStock($stock_id);
		return array ($dng->parseCorrectNumber());
	}
	
	public function getNumber($module, $stock_id) {
		$dng = new EcmDocumentNumberGenerator($module);
		if ($stock_id)
			$dng->setStock($stock_id);
		$template = $dng->getNumberTemplate();
		return array ($dng->parseNumber($template));
	}
}