$totalchecker = $totalchecker + $purchase_detail->getExtendedPrice();
            $counter++;
        }
        ?>
			</tbody>
			<?php 
        $totalchecker = $totalchecker - $purchase->getDiscount();
        if ($totalchecker != $purchase->getTotal()) {
            $purchaseNu = new Purchase($_GET['id']);
            $purchaseNu->setTotal($totalchecker);
            $purchaseNu->store();
        }
        ?>
			<tfoot>
				<tr><td colspan="5"></td><td>Discount</td><td><?php 
        echo $purchase->prepareDiscount(2);
        ?>
</td></tr>
				<tr><td colspan="5" id="addRowBTN"><div class="ui-icon ui-icon-circle-plus span-1 last"></div>Add Row</td><td class="tfootCaption">Total</td><td id="purchaseTotal"><?php 
        echo $purchase->prepareTotal(2);
        ?>
</td></tr>
			</tfoot>
		</table>
		<div class="pdbox span-11"><label>Payment Terms</label><br /><?php 
        echo $purchase->preparePayment();
        ?>
</div>
		<div class="pdbox span-11"><label>Delivery Terms</label><br /><?php 
        echo $purchase->prepareDelivery();
        ?>