diff --git a/controllers/documents_controller.php b/controllers/documents_controller.php index fdc1c7db..fea9e323 100755 --- a/controllers/documents_controller.php +++ b/controllers/documents_controller.php @@ -333,8 +333,14 @@ class DocumentsController extends AppController { $enquiry = $this->Document->OrderAcknowledgement->Enquiry->find('first', array('conditions'=>array('Enquiry.id'=>$originalDoc['Quote']['enquiry_id']))); $enquiry['Enquiry']['status_id'] = 3; //Job Won, Order Placed - $this->Document->OrderAcknowledgement->Enquiry->save($enquiry); + + $customer = $this->Document->OrderAcknowledgement->Enquiry->Customer->find('first', array('conditions'=>array('Customer.id'=>$enquiry['Enquiry']['customer_id']))); + + $customer['Customer']['customer_category_id'] = 3; //make Customer a Creditor + + $this->Document->OrderAcknowledgement->Enquiry->Customer->save($customer); + $job = $this->Document->OrderAcknowledgement->Job->newJob($enquiry); //Only way to know Enquiry ID is if it's a Quote. if($job == false) { @@ -376,7 +382,7 @@ class DocumentsController extends AppController { /** - * Convert an Order Acknowledgement to an Invoice. + * Convert an Order Acknowledgement to an Invoice. * * @TODO Finish this. * @@ -390,7 +396,7 @@ class DocumentsController extends AppController { } - + } diff --git a/views/freight_forwarders/index.ctp b/views/freight_forwarders/index.ctp index 5ec78ecb..23996d75 100644 --- a/views/freight_forwarders/index.ctp +++ b/views/freight_forwarders/index.ctp @@ -8,7 +8,6 @@ echo $paginator->counter(array( ?>
| sort('id');?> | sort('name');?> | |
|---|---|---|
| - - | link(__('View', true), array('action' => 'view', $freightForwarder['FreightForwarder']['id'])); ?> link(__('Edit', true), array('action' => 'edit', $freightForwarder['FreightForwarder']['id'])); ?> - link(__('Delete', true), array('action' => 'delete', $freightForwarder['FreightForwarder']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $freightForwarder['FreightForwarder']['id'])); ?> |