Restored Invoice Editing to allow for them to be marked payment received
This commit is contained in:
parent
c967490bd9
commit
ef42c5e668
|
|
@ -275,8 +275,8 @@ class DocumentsController extends AppController {
|
|||
|
||||
|
||||
$this->set('newDoc', $newDoc);
|
||||
//
|
||||
//print_r($newDoc);
|
||||
//
|
||||
//print_r($newDoc);
|
||||
if ($this->Document->saveAll($newDoc)) {
|
||||
$newid = $this->Document->id;
|
||||
$this->Session->setFlash(__("Revision {$number_of_revisions} created", true));
|
||||
|
|
@ -323,7 +323,7 @@ class DocumentsController extends AppController {
|
|||
* @param <int> $id
|
||||
*/
|
||||
function convert_to_oa($id = null) {
|
||||
//$this->layout = 'ajax';
|
||||
//$this->layout = 'ajax';
|
||||
if (!$id) {
|
||||
echo 'Invalid Document ID';
|
||||
}
|
||||
|
|
@ -375,8 +375,28 @@ class DocumentsController extends AppController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert an Order Acknowledgement to an Invoice.
|
||||
*
|
||||
* @TODO Finish this.
|
||||
*
|
||||
* @param <int> $id
|
||||
*/
|
||||
function convert_to_invoice($id = null) {
|
||||
if (!$id) {
|
||||
echo 'Invalid Document ID';
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function pdf($id = null) {
|
||||
//Configure::write('debug',0);
|
||||
//Configure::write('debug',0);
|
||||
if(!$id) {
|
||||
$this->Session->setFlash(__('Invalid Document', true));
|
||||
$this->redirect(array('controller'=>'documents', 'action'=>'index'));
|
||||
|
|
@ -435,8 +455,8 @@ class DocumentsController extends AppController {
|
|||
$this->set('states', $this->Document->Invoice->Enquiry->State->find('list'));
|
||||
|
||||
|
||||
//Set filename for the document.
|
||||
//
|
||||
//Set filename for the document.
|
||||
//
|
||||
switch($docType) {
|
||||
case "quote":
|
||||
$filename = $enquiry['Enquiry']['title'];
|
||||
|
|
@ -492,10 +512,10 @@ class DocumentsController extends AppController {
|
|||
$document['Document']['pdf_created_at'] = date('Y-m-d H:i:s');
|
||||
$document['Document']['pdf_created_by_user_id'] = $this->getCurrentUserID();
|
||||
if($this->Document->save($document)) {
|
||||
//echo "Set pdf_filename attritbute to: ".$filename;
|
||||
//echo "Set pdf_filename attritbute to: ".$filename;
|
||||
}
|
||||
else {
|
||||
//echo 'Failed to set pdf_filename to: '.$filename;
|
||||
//echo 'Failed to set pdf_filename to: '.$filename;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -38,15 +38,24 @@ class InvoicesController extends AppController {
|
|||
}
|
||||
$emails = $this->Invoice->Email->find('all', array('conditions'=>array('Email.id'=>$emailIDs)));
|
||||
$this->set('emails', $emails);
|
||||
}
|
||||
|
||||
|
||||
function payment_received($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid Invoice.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$invoice = $this->Invoice->read(null, $id);
|
||||
|
||||
$invoice['Invoice']['paid'] = 1;
|
||||
$invoice['Invoice']['payment_received_date'] = date('Y-m-d');
|
||||
$this->Invoice->save($invoice);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*function edit($id = null) {
|
||||
function edit($id = null) {
|
||||
if (!$id && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid Invoice', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
|
|
@ -65,10 +74,9 @@ class InvoicesController extends AppController {
|
|||
|
||||
}
|
||||
|
||||
$users = $this->Invoice->User->find('list');
|
||||
$jobs = $this->Invoice->Job->find('list', array('conditions'=>array('Job.enquiry_id'=>$invoice['Invoice']['enquiry_id'])));
|
||||
$this->set(compact('users', 'jobs'));
|
||||
}*/
|
||||
}
|
||||
|
||||
/*function delete($id = null) {
|
||||
if (!$id) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
echo $form->input('payment_received_date');
|
||||
echo $form->input('enquiry_id', array('type'=>'hidden'));
|
||||
echo $form->input('job_id');
|
||||
echo $form->input('user_id');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
|
|
|
|||
|
|
@ -75,9 +75,7 @@
|
|||
|
||||
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('action' => 'view', $invoice['Invoice']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $invoice['Invoice']['id'])); ?>
|
||||
|
||||
<?=$html->link('Edit', '/invoices/edit/'.$invoice['Invoice']['id']);?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
|||
Loading…
Reference in a new issue