Improved view Enquiry. New Quotes now default to AUD and issue date is the day created
This commit is contained in:
parent
6d8c6915ae
commit
fb94915cde
|
|
@ -71,15 +71,14 @@ class DocumentsController extends AppController {
|
||||||
$this->data['Quote']['enquiry_id'] = $enquiryid;
|
$this->data['Quote']['enquiry_id'] = $enquiryid;
|
||||||
$number_of_revisions = $this->Document->Quote->findCount('Quote.enquiry_id ='. $enquiryid);
|
$number_of_revisions = $this->Document->Quote->findCount('Quote.enquiry_id ='. $enquiryid);
|
||||||
$this->data['Quote']['revision'] = $number_of_revisions;
|
$this->data['Quote']['revision'] = $number_of_revisions;
|
||||||
|
$this->data['Quote']['date_issued'] = date('Y-m-d');
|
||||||
|
$this->data['Quote']['currency_id'] = 2; //All new Quotes default to AUD.
|
||||||
|
|
||||||
|
|
||||||
$this->data['Document']['user_id']= $enquiry['Enquiry']['user_id'];
|
$this->data['Document']['user_id']= $enquiry['Enquiry']['user_id'];
|
||||||
$this->data['Document']['enquiry_id'] = $enquiryid;
|
$this->data['Document']['enquiry_id'] = $enquiryid;
|
||||||
$this->data['Document']['type'] = 'quote';
|
$this->data['Document']['type'] = 'quote';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($this->Document->saveAll($this->data)) {
|
if ($this->Document->saveAll($this->data)) {
|
||||||
$newid = $this->Document->id;
|
$newid = $this->Document->id;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,64 @@
|
||||||
<div class="enquiries-view">
|
<div class="enquiries-view">
|
||||||
<h2><?php __("Enquiry: " . $enquiry['Enquiry']['title']);?></h2>
|
|
||||||
<dl><?php $i = 0;
|
|
||||||
$class = ' class="altrow"';?>
|
|
||||||
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Enquiry Number'); ?></dt>
|
<dl class="enquirySummary">
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dt>Enquiry:</dt>
|
||||||
<?php echo $enquiry['Enquiry']['title']; ?>
|
<dd><?=$enquiry['Enquiry']['title']?></dd>
|
||||||
|
<dt>Customer:</dt>
|
||||||
|
<dd><?=$html->link($enquiry['Customer']['name'], array('controller'=>'customers','action'=>'view', $enquiry['Customer']['id']));?>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
<dt>Contact:</dt>
|
||||||
|
<dd><?=$html->link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'users', 'action'=>'view', $enquiry['Contact']['id'])); ?>
|
||||||
|
<?=$html->link($enquiry['Contact']['email'], 'mailto:'.$enquiry['Contact']['email']);?>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<?
|
||||||
|
|
||||||
|
/* Copy+pasta. Should be a helper of an element or something. Aug_2011_Hackfest_for_victory_and_liberation_from_this_project! */
|
||||||
|
if ($enquiry['Status']['id'] == 3) {
|
||||||
|
$class = ' class="jobwon"';
|
||||||
|
} else if ($enquiry['Status']['id'] == 4) {
|
||||||
|
$class = ' class="joblost"';
|
||||||
|
} else if ($enquiry['Status']['id'] == 8) {
|
||||||
|
$class = ' class="joblost"';
|
||||||
|
} else if ($enquiry['Status']['id'] == 9) {
|
||||||
|
$class = ' class="joblost"';
|
||||||
|
} else if ($enquiry['Status']['id'] == 10) {
|
||||||
|
$class = ' class="joblost"';
|
||||||
|
} else if ($enquiry['Status']['id'] == 6) {
|
||||||
|
$class = ' class="information"';
|
||||||
|
} else if ($enquiry['Status']['id'] == 11) {
|
||||||
|
$class = ' class="informationsent"';
|
||||||
|
} else if ($enquiry['Status']['id'] == 5) {
|
||||||
|
$class = ' class="quoted"';
|
||||||
|
} else if ($enquiry['Status']['id'] == 1) {
|
||||||
|
$class = ' class="requestforquote"';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<dt>Status:</dt>
|
||||||
|
<dd <?=$class?>> <?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?></dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<h3>Details</h3>
|
||||||
|
<dl><?php $i = 0;
|
||||||
|
$class = ' class="altrow"';?>
|
||||||
|
|
||||||
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Assigned to User'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Assigned to User'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $html->link($enquiry['User']['username'], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>
|
<?php echo $html->link($enquiry['User']['username'], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customer'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php echo $html->link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Contact'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php echo $html->link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'contacts', 'action'=>'view', $enquiry['Contact']['id'])); ?>
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('State'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('State'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $html->link($enquiry['State']['name'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?>
|
<?php echo $html->link($enquiry['State']['name'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $html->link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?>
|
<?php echo $html->link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('GST Applicable'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('GST Applicable'); ?></dt>
|
||||||
|
|
@ -42,23 +70,23 @@ $class = ' class="altrow"';?>
|
||||||
else {
|
else {
|
||||||
echo "Yes - GST Applicable";
|
echo "Yes - GST Applicable";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>
|
<?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Status'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Status'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?>
|
<?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Comments'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Comments'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<span class="enquiry-view-comments">
|
<span class="enquiry-view-comments">
|
||||||
<?php echo $enquiry['Enquiry']['comments']; ?>
|
<?php echo $enquiry['Enquiry']['comments']; ?>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
@ -73,7 +101,7 @@ $class = ' class="altrow"';?>
|
||||||
else {
|
else {
|
||||||
echo 'No Billing Address Assigned for this Enquiry';
|
echo 'No Billing Address Assigned for this Enquiry';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
@ -87,8 +115,8 @@ $class = ' class="altrow"';?>
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo 'No Shipping Address Assigned for this Enquiry';
|
echo 'No Shipping Address Assigned for this Enquiry';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
@ -107,20 +135,13 @@ $class = ' class="altrow"';?>
|
||||||
$boxdata['enquirynumber'] = $enquiry['Enquiry']['title'];
|
$boxdata['enquirynumber'] = $enquiry['Enquiry']['title'];
|
||||||
//$boxdata['principle_emails'] = $principle_emails;
|
//$boxdata['principle_emails'] = $principle_emails;
|
||||||
?>
|
?>
|
||||||
<?php echo $this->element('principle_contacts_email_box', array('enquirynumber' => $enquiry['Enquiry']['title'],
|
<?php echo $this->element('principle_contacts_email_box', array('enquirynumber' => $enquiry['Enquiry']['title'],
|
||||||
'principle_emails' => $principle_emails )); ?>
|
'principle_emails' => $principle_emails )); ?>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<? /*
|
|
||||||
<div class="related">
|
|
||||||
<h3><?php __($number_of_files.' Files in this Enquiry');?><?php echo $html->image('document.png'); ?></h3>
|
|
||||||
<?php echo $this->element('enquiry_file_table', $files); ?>
|
|
||||||
</div>
|
|
||||||
*/?>
|
|
||||||
|
|
||||||
<div class="related">
|
<div class="related">
|
||||||
<h3><?php if($enquiry['Enquiry']['quote_count'] > 1) {
|
<h3><?php if($enquiry['Enquiry']['quote_count'] > 1) {
|
||||||
echo $enquiry['Enquiry']['quote_count'].' Quotes for this Enquiry';
|
echo $enquiry['Enquiry']['quote_count'].' Quotes for this Enquiry';
|
||||||
|
|
@ -130,7 +151,8 @@ $class = ' class="altrow"';?>
|
||||||
|
|
||||||
}?>
|
}?>
|
||||||
</h3>
|
</h3>
|
||||||
<?php echo $this->element('quote_table', $quotes); ?>
|
<button>New Quote</button>
|
||||||
|
<?php echo $this->element('quote_table', $quotes); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -154,7 +176,7 @@ $class = ' class="altrow"';?>
|
||||||
|
|
||||||
<th class="actions"><?php __('Actions');?></th>
|
<th class="actions"><?php __('Actions');?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($jobs as $job):
|
foreach ($jobs as $job):
|
||||||
$class = null;
|
$class = null;
|
||||||
|
|
@ -315,8 +337,8 @@ $class = ' class="altrow"';?>
|
||||||
<h3>
|
<h3>
|
||||||
Emails for this Enquiry<?php echo $html->image('internet-mail.png'); ?>
|
Emails for this Enquiry<?php echo $html->image('internet-mail.png'); ?>
|
||||||
</h3>
|
</h3>
|
||||||
<?php echo $this->element('email_table_ajax', array('emails' => $emails)); ?>
|
<?php echo $this->element('email_table_ajax', array('emails' => $emails)); ?>
|
||||||
<?php //echo $this->element('email_table_ajax', $enquiry, array('cache'=>'+1 day')); ?>
|
<?php //echo $this->element('email_table_ajax', $enquiry, array('cache'=>'+1 day')); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ a.headerlinks {
|
||||||
h3 {
|
h3 {
|
||||||
color: #2C5FD5;
|
color: #2C5FD5;
|
||||||
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
|
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
|
||||||
font-size: 130%;
|
font-size: 150%;
|
||||||
/* padding-top: 1.5em; */
|
/* padding-top: 1.5em; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -638,6 +638,9 @@ div.paging span.current {
|
||||||
div.paging span a {
|
div.paging span a {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Scaffold View */
|
/* Scaffold View */
|
||||||
dl {
|
dl {
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
|
|
@ -658,6 +661,46 @@ dt.altrow {
|
||||||
background: #E6F0F0;
|
background: #E6F0F0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Enquiry Details Summary */
|
||||||
|
|
||||||
|
dl.enquirySummary {
|
||||||
|
font-size: 150%;
|
||||||
|
color: #045FB4;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.enquirySummary dt {
|
||||||
|
width: 5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.enquirySummary dd {
|
||||||
|
margin-left: 8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Colors for Enquiry Statuses */
|
||||||
|
|
||||||
|
.joblost {
|
||||||
|
background: #FFC0CB;
|
||||||
|
}
|
||||||
|
.jobwon {
|
||||||
|
background: #55E055;
|
||||||
|
}
|
||||||
|
.information {
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
|
.informationsent {
|
||||||
|
background: #ADD8E6;
|
||||||
|
}
|
||||||
|
.requestforquote {
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#emailHeaders {
|
#emailHeaders {
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
}
|
}
|
||||||
|
|
@ -1565,3 +1608,5 @@ table.lineItems tr td.price {
|
||||||
#userType {
|
#userType {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue