<?php echo $javascript->link('addLineItem'); ?>

<?php echo $javascript->link('lineItemPriceNoCosting'); ?>


<div class="quotes view">
    <h2><?php

        $enquirynumber_link = $html->link($document['Enquiry']['title'],
                array('controller'=>'enquiries', 'action'=>'view', $document['Enquiry']['id']));

        $customer_link = $html->link( $customer['Customer']['name'], array('controller'=>'customers', 'action' => 'view', $customer['Customer']['id']));

        if($docType == 'quote') {

            if($document['Quote']['revision'] == 0) {
                __('Quote: '.$enquirynumber_link. ' for '. $customer_link);
            }
            else {
                __('Quote: '.$enquirynumber_link.' Revision '.$document['Quote']['revision'].' for '. $customer_link);
            }
        }
        else if($docType == 'invoice') {
            __('Invoice: '.$document['Invoice']['title']. ' for '. $customer_link);
        }

        ?></h2>

    <?php foreach($pages as $page): ?>
    <h3 class="pagenumber">Page <?php echo $page['page_number']; ?></h3>

        <? if($page['contentPage'] == 1): ?>
    <div class="pageview">
                <?php echo $page['content'];?>
    </div>
        <?php else: ?>

    <div class="lineitems">

    </div>

        <?php endif;?>
    <?php endforeach; ?>


</div>

<div id="mydebug"></div>

<? //debug($document); ?>

<?php // debug($pages); ?>

<?php debug($customer); ?>

<?php echo "DocType is: ".$docType; ?>