invoice register working. now jobs
This commit is contained in:
parent
e42e11a516
commit
d1838e169c
|
|
@ -17,14 +17,6 @@ class AppController extends Controller {
|
||||||
$this->Auth->authorize = 'controller';
|
$this->Auth->authorize = 'controller';
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define the scheme for issue Types.
|
|
||||||
*/
|
|
||||||
$this->set('issueTypes', array(1=>"Bug Report", 2=>"Feature Request", 3=>"Other IT Help"));
|
|
||||||
|
|
||||||
$priorities = array(1 => 'Low',2=> "Medium",3=> "High", 4=> "Critical");
|
|
||||||
$this->set('issuePriorities', $priorities);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($this->RequestHandler->isAjax()) {
|
if($this->RequestHandler->isAjax()) {
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,9 @@ class EnquiriesController extends AppController {
|
||||||
|
|
||||||
//$this->set('quotes', $enquiry['Quote']);
|
//$this->set('quotes', $enquiry['Quote']);
|
||||||
$this->set('quotes', $this->Enquiry->Quote->find('all', array('recursive' => 0, 'conditions'=>array('Quote.enquiry_id'=>$id), 'order'=>'Quote.revision DESC')));
|
$this->set('quotes', $this->Enquiry->Quote->find('all', array('recursive' => 0, 'conditions'=>array('Quote.enquiry_id'=>$id), 'order'=>'Quote.revision DESC')));
|
||||||
|
|
||||||
|
$this->set('invoices', $this->Enquiry->Invoice->find('all', array('conditions' => array('Invoice.enquiry_id' => $id))));
|
||||||
|
|
||||||
//$this->set('files', $this->Enquiry->EnquiryFile->find('all', array('conditions' => array('EnquiryFile.enquiry_id'=>$id), 'order' => 'EnquiryFile.created ASC')));
|
//$this->set('files', $this->Enquiry->EnquiryFile->find('all', array('conditions' => array('EnquiryFile.enquiry_id'=>$id), 'order' => 'EnquiryFile.created ASC')));
|
||||||
|
|
||||||
/* Trying to optimise the queries for this part of the view - it's currently getting bogged down checking Email Attachments.
|
/* Trying to optimise the queries for this part of the view - it's currently getting bogged down checking Email Attachments.
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ class Enquiry extends AppModel {
|
||||||
|
|
||||||
var $name = 'Enquiry';
|
var $name = 'Enquiry';
|
||||||
|
|
||||||
|
//var $recursive = 2;
|
||||||
|
|
||||||
var $validate = array(
|
var $validate = array(
|
||||||
'user_id' => array(
|
'user_id' => array(
|
||||||
'rule' => 'numeric',
|
'rule' => 'numeric',
|
||||||
|
|
@ -175,6 +177,8 @@ class Enquiry extends AppModel {
|
||||||
'foreignKey' => 'enquiry_id',
|
'foreignKey' => 'enquiry_id',
|
||||||
'dependent' => false
|
'dependent' => false
|
||||||
),
|
),
|
||||||
|
'Invoice' => array('className' => 'Invoice',
|
||||||
|
'foreignKey'=>'enquiry_id')
|
||||||
|
|
||||||
|
|
||||||
/* 'EnquiryFile' => array('className' => 'EnquiryFile',
|
/* 'EnquiryFile' => array('className' => 'EnquiryFile',
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ class User extends AppModel {
|
||||||
|
|
||||||
var $belongsTo = array('Group');
|
var $belongsTo = array('Group');
|
||||||
|
|
||||||
|
var $displayField = 'username';
|
||||||
|
|
||||||
/* TO DO: Fix up this validation stuff
|
/* TO DO: Fix up this validation stuff
|
||||||
var $validate = array(
|
var $validate = array(
|
||||||
'username' => array(
|
'username' => array(
|
||||||
|
|
|
||||||
4
vendors/shells/vault.php
vendored
4
vendors/shells/vault.php
vendored
|
|
@ -26,10 +26,10 @@ class VaultShell extends Shell {
|
||||||
|
|
||||||
if($testing == 1) {
|
if($testing == 1) {
|
||||||
$email_dir = '/Users/karlcordes/Sites/quotenik/app/emails';
|
$email_dir = '/Users/karlcordes/Sites/quotenik/app/emails';
|
||||||
|
|
||||||
$ripmime_path = '/opt/local/bin/ripmime';
|
$ripmime_path = '/opt/local/bin/ripmime';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$mbox = imap_open("{mail.cmctechnologies.com.au:143/novalidate-cert}INBOX", $username, $password) or die("can't connect: " . imap_last_error());
|
$mbox = imap_open("{mail.cmctechnologies.com.au:143/novalidate-cert}INBOX", $username, $password) or die("can't connect: " . imap_last_error());
|
||||||
$MC = imap_check($mbox);
|
$MC = imap_check($mbox);
|
||||||
$number_of_messages = $MC->Nmsgs;
|
$number_of_messages = $MC->Nmsgs;
|
||||||
|
|
@ -55,8 +55,6 @@ class VaultShell extends Shell {
|
||||||
//Generate a Uniqid for this email.
|
//Generate a Uniqid for this email.
|
||||||
$uniqid = $this->getUniqId($email_dir);
|
$uniqid = $this->getUniqId($email_dir);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$this->Email->create();
|
$this->Email->create();
|
||||||
$this->data['Email']['enquiry_id'] = $enquiry['Enquiry']['id'];
|
$this->data['Email']['enquiry_id'] = $enquiry['Enquiry']['id'];
|
||||||
$this->data['Email']['to'] = $message['to'];
|
$this->data['Email']['to'] = $message['to'];
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,85 @@ $class = ' class="altrow"';?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="related">
|
||||||
|
<h3><?php __($enquiry['Enquiry']['invoice_count'].' Invoices for this Enquiry');?></h3>
|
||||||
|
<table class="quotetable">
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th>Issue Date</th>
|
||||||
|
<th>Due Date</th>
|
||||||
|
<th>Invoice Number</th>
|
||||||
|
<th>Customer</th>
|
||||||
|
<th>Paid / Unpaid</th>
|
||||||
|
<th>Payment Received Date</th>
|
||||||
|
<th>User</th>
|
||||||
|
<th class="actions"><?php __('Actions');?></th>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
$i = 0;
|
||||||
|
foreach ($invoices as $invoice):
|
||||||
|
$class = null;
|
||||||
|
if ($i++ % 2 == 0) {
|
||||||
|
$class = ' class="altrow"';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr<?php echo $class;?>>
|
||||||
|
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?php echo date('j M Y',$time->toUnix($invoice['Invoice']['issue_date'])); ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php echo date('j M Y',$time->toUnix($invoice['Invoice']['due_date'])); ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php echo $invoice['Invoice']['title']; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<? echo $html->link($invoice['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $invoice['Customer']['id'])); ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
if($invoice['Invoice']['paid'] == 0) {
|
||||||
|
echo "UNPAID";
|
||||||
|
echo "</td>";
|
||||||
|
echo "<td>";
|
||||||
|
echo "N/A";
|
||||||
|
echo "</td>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "PAID";
|
||||||
|
echo "</td>";
|
||||||
|
echo "<td>";
|
||||||
|
echo date('j M Y',$time->toUnix($invoice['Invoice']['payment_received_date']));
|
||||||
|
echo "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?php echo $html->link($invoice['User']['username'], array('controller' => 'users', 'action' => 'view', $invoice['User']['id'])); ?>
|
||||||
|
</td>
|
||||||
|
<td class="actions">
|
||||||
|
<?php echo $html->link(__('View', true), array('controller'=>'invoices', 'action' => 'view', $invoice['Invoice']['id'])); ?>
|
||||||
|
<?php echo $html->link(__('Edit', true), array('controller'=>'invoices','action' => 'edit', $invoice['Invoice']['id'])); ?>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="actions">
|
||||||
|
<ul>
|
||||||
|
<li><?php echo $html->link(__('New Invoice', true), array('controller'=>'invoices', 'action' => 'add/enquiryid:'.$enquiry['Enquiry']['id'])); ?></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="showemail">
|
<div id="showemail">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,12 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li><?php echo $html->link('Invoices', '/invoices/index'); ?>
|
||||||
|
<ul>
|
||||||
|
<li class="last"><?php echo $html->link('Invoices Index', '/invoices/index'); ?></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li><?php echo $html->link('Products', '/products/index'); ?>
|
<li><?php echo $html->link('Products', '/products/index'); ?>
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo $html->link('Product Index', '/products/index'); ?></li>
|
<li><?php echo $html->link('Product Index', '/products/index'); ?></li>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue