<?php
$sql = "SELECT Auftrag_ID, Vorkasse, Schluss_Rechnung FROM " . PREFIX . "_Rechnungen WHERE (Jahr = \"" . $Jahr . "\" AND ID = \"" . $ID . "\");";
$result = $db->query($sql);
$nt = $result->fetch_assoc();
if ("0" == $nt['Auftrag_ID'])
{
	include __DIR__ . "/rech_oa.php";
	return (0);
}
if ($nt['Vorkasse'])
{
	include __DIR__ . "/rech_vk.php";
	return (0);
}
if ($nt['Schluss_Rechnung'])
{
	include __DIR__ . "/rech_sr.php";
	return (0);
}
include __DIR__ . "/rech_az.php";