Hopefully fixed POs
This commit is contained in:
parent
1a3e3a6f27
commit
9be038ddc4
|
|
@ -868,6 +868,19 @@ ENDINSTRUCTIONS;
|
|||
break;
|
||||
case 'purchaseOrder':
|
||||
$subject .= " Purchase Order";
|
||||
|
||||
$primary_contact = $this->Document->User->find('first', array('conditions'=>array('User.principle_id' => $document['PurchaseOrder']['principle_id'],'User.primary_contact' => 1)));
|
||||
if(empty($primary_contact)) {
|
||||
|
||||
$this->Session->setFlash(__('Unable to send. No primary Principle Contact', true));
|
||||
$this->redirect(array('action'=>'view/'.$id), null, false);
|
||||
return;
|
||||
}
|
||||
$this->Email->subject = 'CMC Technologies Purchase Order: '.$document['PurchaseOrder']['title'];
|
||||
|
||||
$this->Email->to = $primary_contact['User']['email'];
|
||||
$this->Email->replyTo = null;
|
||||
$this->Email->cc = null;
|
||||
$this->set('job', $this->Document->PurchaseOrder->Job->find('first', array('conditions'=>array('Job.id'=>$document['OrderAcknowledgement']['job_id']))));
|
||||
break;
|
||||
case 'orderAck':
|
||||
|
|
|
|||
Loading…
Reference in a new issue