</table>
	  			</td>
    		</tr>
			<tr>
				<td class="bgcolor_004" align="left">						
				</td>
				<td class="bgcolor_005" align="left" >
					<center>
						<input type="image"  name="image16" align="top" border="0" src="<?php 
    echo Images_Path;
    ?>
/button-search.gif" />						
					</center>	
				</td>
			</tr>			
		</tbody>
	</table>
</FORM>
</center>
<?php 
}
if ($posted == 1) {
    switch ($exporttype) {
        case 'html':
            $invoice->DisplayHTML($smarty, 'sales', $templatefile);
            break;
        case 'pdf':
            $invoice->DisplayPDF($smarty, 'sales', $templatefile);
            break;
    }
}
            if ($payment_status != "") {
                $QUERY = "UPDATE cc_invoice SET payment_status ='{$payment_status}' WHERE id='{$id}'";
                $DBHandle->Execute($QUERY);
                if ($verbose_level >= 1) {
                    echo "\nQUERY_INVOICESTATUS: " . $QUERY;
                }
            }
            $invoice_type_name = 'billed';
            break;
        default:
            throw new Exception("invoice_type unknown");
    }
    // Display Invoice (& Commands)
    switch ($exporttype) {
        case 'html':
            $invoice->DisplayHTML($smarty, $invoice_type_name, $templatefile);
            // Display Commands on billed invoice
            if ($invoice_type == 2) {
                ?>
				<form  method="post" action="A2B_entity_invoices2_detail.php?id=$id&invoice_type=2&exporttype=html&templatefile=$templatefile">
					<select NAME="payment_status" size="1" class="form_input_select">
					<?php 
                foreach ($payment_status_list as $data) {
                    ?>
						<option value='<?php 
                    echo $data[1];
                    ?>
' <?php 
                    if ($invoice->payment_status == $data[1]) {
                        ?>
selected<?php