jQuery edit in place for the Enquiry Register working nicely
This commit is contained in:
parent
7534bc2756
commit
b77598749a
|
|
@ -2,49 +2,50 @@
|
|||
|
||||
class EnquiriesController extends AppController {
|
||||
|
||||
var $name = 'Enquiries';
|
||||
var $helpers = array('Html', 'Form', 'Javascript', 'Time', 'Ajax', 'Number', 'Text', 'Cache');
|
||||
|
||||
var $paginate = array(
|
||||
|
||||
'contain' => false,
|
||||
'limit' => 250,
|
||||
'order'=>array('Enquiry.id' => 'desc')
|
||||
var $name = 'Enquiries';
|
||||
var $helpers = array('Html', 'Form', 'Javascript', 'Time', 'Ajax', 'Number', 'Text', 'Cache');
|
||||
|
||||
);
|
||||
var $paginate = array(
|
||||
|
||||
var $components = array('RequestHandler', 'Email');
|
||||
'contain' => false,
|
||||
'limit' => 250,
|
||||
'order'=>array('Enquiry.id' => 'desc')
|
||||
|
||||
var $cacheAction = "1 hour";
|
||||
);
|
||||
|
||||
var $components = array('RequestHandler', 'Email');
|
||||
|
||||
var $cacheAction = "1 hour";
|
||||
|
||||
|
||||
function index() {
|
||||
$this->Enquiry->recursive = 0;
|
||||
$this->set('enquiries', $this->paginate());
|
||||
$statuses = $this->Enquiry->Status->find('all', array('recursive'=>0));
|
||||
$status_list = array();
|
||||
foreach ($statuses as $status) {
|
||||
$status_list[] = array($status['Status']['id'], $status['Status']['name']);
|
||||
}
|
||||
$this->set('status_list', $status_list);
|
||||
//debug($this->paginate());
|
||||
// $this->set('status_list', $this->Enquiry->Status->find('list'));
|
||||
}
|
||||
function index() {
|
||||
$this->Enquiry->recursive = 0;
|
||||
$this->set('enquiries', $this->paginate());
|
||||
$statuses = $this->Enquiry->Status->find('all', array('recursive'=>0));
|
||||
$status_list = array();
|
||||
foreach ($statuses as $status) {
|
||||
$statusid = $status['Status']['id'];
|
||||
$status_list[$statusid] = $status['Status']['name'];
|
||||
}
|
||||
$this->set('status_list', $status_list);
|
||||
//debug($this->paginate());
|
||||
// $this->set('status_list', $this->Enquiry->Status->find('list'));
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid Enquiry.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
//$enquiry = $this->Enquiry->read(null, $id);
|
||||
$enquiry = $this->Enquiry->find('first', array('recursive' => 0, 'conditions' => array('Enquiry.id'=>$id)
|
||||
));
|
||||
$this->set('enquiry', $enquiry);
|
||||
|
||||
//$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('files', $this->Enquiry->EnquiryFile->find('all', array('conditions' => array('EnquiryFile.enquiry_id'=>$id), 'order' => 'EnquiryFile.created ASC')));
|
||||
|
||||
function view($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid Enquiry.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
//$enquiry = $this->Enquiry->read(null, $id);
|
||||
$enquiry = $this->Enquiry->find('first', array('recursive' => 0, 'conditions' => array('Enquiry.id'=>$id)
|
||||
));
|
||||
$this->set('enquiry', $enquiry);
|
||||
|
||||
//$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('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.
|
||||
* Going to create an array describing whether a particular email ID has an attachment. Trying to avoid checking binary data in a find('all') call
|
||||
*/
|
||||
|
|
@ -63,377 +64,403 @@ class EnquiriesController extends AppController {
|
|||
* Fix up Email Attachment icon on email box. Currently broken -KC 6/8/09
|
||||
$this->set('number_of_emails', $this->Enquiry->Email->find('count', array('conditions'=>array('Email.enquiry_id'=>$id))));
|
||||
*/
|
||||
$this->set('number_of_quotes', $this->Enquiry->Quote->find('count', array('conditions'=>array('Quote.enquiry_id'=>$id))));
|
||||
//$this->set('number_of_files', $this->Enquiry->EnquiryFile->find('count', array('conditions' => array('EnquiryFile.enquiry_id'=>$id))));
|
||||
$this->set('principle_emails', $this->Enquiry->Principle->PrincipleContact->findAllByPrincipleId($enquiry['Enquiry']['principle_id']));
|
||||
$this->set('number_of_quotes', $this->Enquiry->Quote->find('count', array('conditions'=>array('Quote.enquiry_id'=>$id))));
|
||||
//$this->set('number_of_files', $this->Enquiry->EnquiryFile->find('count', array('conditions' => array('EnquiryFile.enquiry_id'=>$id))));
|
||||
$this->set('principle_emails', $this->Enquiry->Principle->PrincipleContact->findAllByPrincipleId($enquiry['Enquiry']['principle_id']));
|
||||
|
||||
|
||||
if($enquiry['Enquiry']['billing_address_id'] != 0) {
|
||||
$this->set('billingaddress', $this->Enquiry->BillingAddress->findById($enquiry['Enquiry']['billing_address_id']));
|
||||
}
|
||||
|
||||
if($enquiry['Enquiry']['shipping_address_id'] != 0) {
|
||||
$this->set('shippingaddress', $this->Enquiry->ShippingAddress->findById($enquiry['Enquiry']['shipping_address_id']));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($enquiry['Enquiry']['billing_address_id'] != 0) {
|
||||
$this->set('billingaddress', $this->Enquiry->BillingAddress->findById($enquiry['Enquiry']['billing_address_id']));
|
||||
}
|
||||
|
||||
function add() {
|
||||
|
||||
if(empty($this->data)) {
|
||||
if(isset($this->params['named']['customerid'])) {
|
||||
$customer = $this->Enquiry->Customer->findById($this->params['named']['customerid']);
|
||||
}
|
||||
else {
|
||||
$this->Session->setFlash(__('The customer must already exist in the database. Please add Enquiries to an existing Customer', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($customer)) {
|
||||
if($enquiry['Enquiry']['shipping_address_id'] != 0) {
|
||||
$this->set('shippingaddress', $this->Enquiry->ShippingAddress->findById($enquiry['Enquiry']['shipping_address_id']));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function add() {
|
||||
|
||||
if(empty($this->data)) {
|
||||
if(isset($this->params['named']['customerid'])) {
|
||||
$customer = $this->Enquiry->Customer->findById($this->params['named']['customerid']);
|
||||
}
|
||||
else {
|
||||
$this->Session->setFlash(__('The customer must already exist in the database. Please add Enquiries to an existing Customer', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($customer)) {
|
||||
/* Check if the customer exists in the database - otherwise send the user back to step 1*/
|
||||
if(!$customer) {
|
||||
$this->Session->setFlash(__('The customer must already exist in the database. Please try again', true));
|
||||
$this->redirect(array('action'=>'add'));
|
||||
}
|
||||
|
||||
$this->__showPage2($customer);
|
||||
$this->render();
|
||||
|
||||
}
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$customer = $this->Enquiry->Customer->findById($this->data['Enquiry']['customer_id']);
|
||||
$principle = $this->Enquiry->Principle->findById($this->data['Enquiry']['principle_id']);
|
||||
$this->data['Enquiry']['principle_code'] = $principle['Principle']['code']; //Store which principle code this enquiry belongs to.
|
||||
//Sanitize::clean($this->data);
|
||||
if(isset($this->data['Contact']['new'])) {
|
||||
if($this->data['Contact']['new']) {
|
||||
$this->Enquiry->Contact->save($this->data);
|
||||
$this->data['Enquiry']['contact_id'] = $this->Enquiry->Contact->id;
|
||||
}
|
||||
}
|
||||
$this->Enquiry->set($this->data);
|
||||
if($this->Enquiry->validates()) {
|
||||
if(!$customer) {
|
||||
$this->Session->setFlash(__('The customer must already exist in the database. Please try again', true));
|
||||
$this->redirect(array('action'=>'add'));
|
||||
}
|
||||
|
||||
$this->__showPage2($customer);
|
||||
$this->render();
|
||||
|
||||
}
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$customer = $this->Enquiry->Customer->findById($this->data['Enquiry']['customer_id']);
|
||||
$principle = $this->Enquiry->Principle->findById($this->data['Enquiry']['principle_id']);
|
||||
$this->data['Enquiry']['principle_code'] = $principle['Principle']['code']; //Store which principle code this enquiry belongs to.
|
||||
//Sanitize::clean($this->data);
|
||||
if(isset($this->data['Contact']['new'])) {
|
||||
if($this->data['Contact']['new']) {
|
||||
$this->Enquiry->Contact->save($this->data);
|
||||
$this->data['Enquiry']['contact_id'] = $this->Enquiry->Contact->id;
|
||||
}
|
||||
}
|
||||
$this->Enquiry->set($this->data);
|
||||
if($this->Enquiry->validates()) {
|
||||
|
||||
$enquiryno = $this->__generateEnquiryNumber($this->data);
|
||||
$this->data['Enquiry']['title'] = $enquiryno;
|
||||
$this->Enquiry->create();
|
||||
if ($this->Enquiry->save($this->data)) {
|
||||
$id = $this->Enquiry->id;
|
||||
if($this->data['Enquiry']['send_enquiry_email'] == 1) {
|
||||
$this->__sendNewEnquiryEmail($id); //Will change this to be the queue at some point.
|
||||
}
|
||||
else {
|
||||
$this->Session->setFlash(__('The Enquiry has been saved but the Contact has NOT been emailed, as you requested.', true));
|
||||
$this->redirect(array('action'=>'view/'.$id), null, false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->Session->setFlash(__('The Enquiry could not be saved. Please, try again.', true));
|
||||
$this->__showPage2($this->Enquiry->Customer->findById($this->data['Enquiry']['customer_id']));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
$this->set('errors', $this->Enquiry->invalidFields());
|
||||
$this->__showPage2($customer);
|
||||
$this->render();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$enquiryno = $this->__generateEnquiryNumber($this->data);
|
||||
$this->data['Enquiry']['title'] = $enquiryno;
|
||||
$this->Enquiry->create();
|
||||
if ($this->Enquiry->save($this->data)) {
|
||||
$id = $this->Enquiry->id;
|
||||
if($this->data['Enquiry']['send_enquiry_email'] == 1) {
|
||||
$this->__sendNewEnquiryEmail($id); //Will change this to be the queue at some point.
|
||||
}
|
||||
else {
|
||||
$this->Session->setFlash(__('The Enquiry has been saved but the Contact has NOT been emailed, as you requested.', true));
|
||||
$this->redirect(array('action'=>'view/'.$id), null, false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->Session->setFlash(__('The Enquiry could not be saved. Please, try again.', true));
|
||||
$this->__showPage2($this->Enquiry->Customer->findById($this->data['Enquiry']['customer_id']));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
$this->set('errors', $this->Enquiry->invalidFields());
|
||||
$this->__showPage2($customer);
|
||||
$this->render();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Internal function to display page 2 of the Add Enquiry Form Wizard
|
||||
* to help make the flow-control logic of the add function clearer.
|
||||
* */
|
||||
function __showPage2($customer) {
|
||||
|
||||
function __showPage2($customer) {
|
||||
|
||||
/* Combine the first_name and last_name for the Contact Drop Down Box */
|
||||
$contacts = $this->Enquiry->Contact->find('all', array('conditions' => array('Contact.customer_id' => $customer['Customer']['id'])));
|
||||
$contacts = Set::Combine($contacts, '{n}.Contact.id', array('{0} {1}', '{n}.Contact.first_name', '{n}.Contact.last_name'));
|
||||
$states = $this->Enquiry->State->find('list');
|
||||
$countries = $this->Enquiry->Country->find('list', array('order'=> 'Country.name asc'));
|
||||
$principles = $this->Enquiry->Principle->find('list', array('order' => 'Principle.name asc'));
|
||||
$statuses = $this->Enquiry->Status->find('list');
|
||||
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username')));
|
||||
$this->set(compact('users', 'customers', 'states', 'countries', 'principles', 'statuses', 'contacts', 'customer'));
|
||||
$customerAddresses = $this->Enquiry->BillingAddress->find('all', array('conditions'=>array('BillingAddress.customer_id' => $customer['Customer']['id'])));
|
||||
$this->set('billing_addresses', $customerAddresses);
|
||||
$this->set('shipping_addresses', $customerAddresses);
|
||||
$this->set('errors', $this->Enquiry->invalidFields());
|
||||
$contacts = $this->Enquiry->Contact->find('all', array('conditions' => array('Contact.customer_id' => $customer['Customer']['id'])));
|
||||
$contacts = Set::Combine($contacts, '{n}.Contact.id', array('{0} {1}', '{n}.Contact.first_name', '{n}.Contact.last_name'));
|
||||
$states = $this->Enquiry->State->find('list');
|
||||
$countries = $this->Enquiry->Country->find('list', array('order'=> 'Country.name asc'));
|
||||
$principles = $this->Enquiry->Principle->find('list', array('order' => 'Principle.name asc'));
|
||||
$statuses = $this->Enquiry->Status->find('list');
|
||||
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username')));
|
||||
$this->set(compact('users', 'customers', 'states', 'countries', 'principles', 'statuses', 'contacts', 'customer'));
|
||||
$customerAddresses = $this->Enquiry->BillingAddress->find('all', array('conditions'=>array('BillingAddress.customer_id' => $customer['Customer']['id'])));
|
||||
$this->set('billing_addresses', $customerAddresses);
|
||||
$this->set('shipping_addresses', $customerAddresses);
|
||||
$this->set('errors', $this->Enquiry->invalidFields());
|
||||
/* Feels like an ugly hack. But it gets the desired effect and it will do for now */
|
||||
|
||||
if(isset($customerAddresses[0]['BillingAddress'])) {
|
||||
$billing_address_list[0] = "No Address Selected";
|
||||
foreach ($customerAddresses as $address) {
|
||||
$i = $address['BillingAddress']['id'];
|
||||
$billing_address_list[$i] = $address['BillingAddress']['address'].'<br>'.$address['BillingAddress']['city'].' '.$address['State']['name'].' '.$address['BillingAddress']['postcode'].'<br>'.up($address['Country']['name']).'<br><br>';
|
||||
}
|
||||
$this->set('billing_addresses_list', $billing_address_list);
|
||||
$this->set('shipping_addresses_list', $billing_address_list);
|
||||
}
|
||||
else {
|
||||
$this->set('billing_addresses_list', 'No Addresses exist for this Customer. Please add one');
|
||||
$this->set('shipping_addresses_list', 'No Addresses exist for this Customer. Please add one');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($customerAddresses[0]['BillingAddress'])) {
|
||||
$billing_address_list[0] = "No Address Selected";
|
||||
foreach ($customerAddresses as $address) {
|
||||
$i = $address['BillingAddress']['id'];
|
||||
$billing_address_list[$i] = $address['BillingAddress']['address'].'<br>'.$address['BillingAddress']['city'].' '.$address['State']['name'].' '.$address['BillingAddress']['postcode'].'<br>'.up($address['Country']['name']).'<br><br>';
|
||||
}
|
||||
$this->set('billing_addresses_list', $billing_address_list);
|
||||
$this->set('shipping_addresses_list', $billing_address_list);
|
||||
}
|
||||
else {
|
||||
$this->set('billing_addresses_list', 'No Addresses exist for this Customer. Please add one');
|
||||
$this->set('shipping_addresses_list', 'No Addresses exist for this Customer. Please add one');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Add enquiry_id to the Email Queue */
|
||||
|
||||
function __addToQueue($id) {
|
||||
$enquiry = $this->Enquiry->read(null, $id);
|
||||
$this->Enquiry->EnquiryEmailQueue->create();
|
||||
$this->data['EnquiryEmailQueue']['enquiry_id'] = $enquiry['Enquiry']['id'];
|
||||
if ($this->Enquiry->EnquiryEmailQueue->save($this->data)) {
|
||||
$this->Session->setFlash(__('The Enquiry has been saved and the Enquiry notification email has been added to the Queue', true));
|
||||
$this->redirect(array('action'=>'view/'.$enquiry['Enquiry']['id']), null, false);
|
||||
|
||||
}
|
||||
else {
|
||||
$this->Session->setFlash(__('The Enquiry has been saved but the notification email could not be added to the Queue.', true));
|
||||
$this->redirect(array('action'=>'view/'.$enquiry['Enquiry']['id']), null, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function __addToQueue($id) {
|
||||
$enquiry = $this->Enquiry->read(null, $id);
|
||||
$this->Enquiry->EnquiryEmailQueue->create();
|
||||
$this->data['EnquiryEmailQueue']['enquiry_id'] = $enquiry['Enquiry']['id'];
|
||||
if ($this->Enquiry->EnquiryEmailQueue->save($this->data)) {
|
||||
$this->Session->setFlash(__('The Enquiry has been saved and the Enquiry notification email has been added to the Queue', true));
|
||||
$this->redirect(array('action'=>'view/'.$enquiry['Enquiry']['id']), null, false);
|
||||
|
||||
}
|
||||
else {
|
||||
$this->Session->setFlash(__('The Enquiry has been saved but the notification email could not be added to the Queue.', true));
|
||||
$this->redirect(array('action'=>'view/'.$enquiry['Enquiry']['id']), null, false);
|
||||
}
|
||||
}
|
||||
|
||||
/* Generate Enquiry number and return it as a string */
|
||||
|
||||
function __generateEnquiryNumber($data) {
|
||||
$state = $this->Enquiry->State->findById($data['Enquiry']['state_id']);
|
||||
$principle = $this->Enquiry->Principle->findById($data['Enquiry']['principle_id']);
|
||||
|
||||
function __generateEnquiryNumber($data) {
|
||||
$state = $this->Enquiry->State->findById($data['Enquiry']['state_id']);
|
||||
$principle = $this->Enquiry->Principle->findById($data['Enquiry']['principle_id']);
|
||||
/* Generate the enquiry number for this enquiry */
|
||||
/* CMC Enquiry number format is:
|
||||
* CMC<INCREMENTAL_NUMBER><STATE_INITIAL>E<PRINCIPLE_CODE><NO_OF_ENQ_FOR_THIS_PRINCIPLE_CODE>-<NO_OF_ENQ_FOR_THIS_PRINCIPLE_CODE_IN_THIS_STATE>
|
||||
* eg. CMC1245NE351234-456 */
|
||||
|
||||
$enquiryid = $this->Enquiry->findCount(); /* Find what number we are - CMCXXXX */
|
||||
$enquiryoffset = 7882; //What Number Enquiry we were at before using this package.
|
||||
$enquiryid += $enquiryoffset;
|
||||
$enquiryid++;
|
||||
|
||||
$enquiryid = $this->Enquiry->findCount(); /* Find what number we are - CMCXXXX */
|
||||
$enquiryoffset = 7882; //What Number Enquiry we were at before using this package.
|
||||
$enquiryid += $enquiryoffset;
|
||||
$enquiryid++;
|
||||
/* Find how many enquiries have been for this principle code */
|
||||
$principleenquiries = $this->Enquiry->findCount('principle_code ='. $principle['Principle']['code']);
|
||||
|
||||
$principleenquiries = $this->Enquiry->findCount('principle_code ='. $principle['Principle']['code']);
|
||||
|
||||
/* Principle Code Offsets - Existing Number of Enquiries for each Principle Code */
|
||||
$principlecode_offset = array( 15 => 207, //ELMAC, AMAL
|
||||
20 => 51, //T and B Electronic
|
||||
25 => 2062, //ATEX,Brilex,Marston
|
||||
35 => 2067, //Mid-West Instrument, DP
|
||||
36 => 47, //Reading Technologies
|
||||
37 => 2040, //Eldridge, Smart Measurement, Alia
|
||||
65 => 2212, //Papenmeier, Herberts Industrieglas
|
||||
85 => 586, //Analytical Systems, Misc
|
||||
95 => 181); //Comet, T and D.
|
||||
$principleenquiries += $principlecode_offset[$principle['Principle']['code']]; //Add the offset.
|
||||
$principleenquiries++;
|
||||
|
||||
|
||||
|
||||
$principlecode_offset = array( 15 => 207, //ELMAC, AMAL
|
||||
20 => 51, //T and B Electronic
|
||||
25 => 2062, //ATEX,Brilex,Marston
|
||||
35 => 2067, //Mid-West Instrument, DP
|
||||
36 => 47, //Reading Technologies
|
||||
37 => 2040, //Eldridge, Smart Measurement, Alia
|
||||
65 => 2212, //Papenmeier, Herberts Industrieglas
|
||||
85 => 586, //Analytical Systems, Misc
|
||||
95 => 181); //Comet, T and D.
|
||||
$principleenquiries += $principlecode_offset[$principle['Principle']['code']]; //Add the offset.
|
||||
$principleenquiries++;
|
||||
|
||||
|
||||
|
||||
/* Find how many enquiries have been for this principle code in this state */
|
||||
/* This aspect of the enquiry number is not useful anymore. Made redundant thanks to mySQL queries.
|
||||
* But this has been done for backwards-compatablity with existing enquiry numbers */
|
||||
$principleconditions = array
|
||||
(
|
||||
"Enquiry.principle_code" => $principle['Principle']['code'],
|
||||
"Enquiry.state_id" => $data['Enquiry']['state_id']
|
||||
);
|
||||
|
||||
$stateprincipleenquiries = $this->Enquiry->findCount($principleconditions);
|
||||
|
||||
$principleconditions = array
|
||||
(
|
||||
"Enquiry.principle_code" => $principle['Principle']['code'],
|
||||
"Enquiry.state_id" => $data['Enquiry']['state_id']
|
||||
);
|
||||
|
||||
$stateprincipleenquiries = $this->Enquiry->findCount($principleconditions);
|
||||
|
||||
/*Add the offsets for the State Principle Enquiries for each Code */
|
||||
$stateprinciple_offset = array(
|
||||
//Elmac, Amal
|
||||
15 => array("NSW" => 39, "VIC" => 38, "TAS" => 58,
|
||||
"ACT" => 0, "QLD" => 30, "NT" => 0,
|
||||
"WA" => 19, "SA" => 8, "Overseas" => 1),
|
||||
//T and B Electronic
|
||||
20 => array("NSW" => 14, "VIC" => 6, "TAS" => 0,
|
||||
"ACT" => 0, "QLD" => 8, "NT" => 0,
|
||||
"WA" => 12, "SA" => 1, "Overseas" => 5),
|
||||
//ATEX,Brilex,Marston
|
||||
25 => array("NSW" => 580, "VIC" => 599, "TAS" => 186,
|
||||
"ACT" => 0, "QLD" => 254, "NT" => 3,
|
||||
"WA" => 541, "SA" => 72, "Overseas" => 625),
|
||||
//Mid-West Instrument, DP
|
||||
35 => array("NSW" => 549, "VIC" => 851, "TAS" => 9,
|
||||
"ACT" => 0, "QLD" => 245, "NT" => 15,
|
||||
"WA" => 470, "SA" => 508, "Overseas" => 154),
|
||||
//Reading Technologies
|
||||
36 => array("NSW" => 1, "VIC" => 3, "TAS" => 0,
|
||||
"ACT" => 0, "QLD" => 7, "NT" => 0,
|
||||
"WA" => 0, "SA" => 4, "Overseas" => 2),
|
||||
//Eldridge, Smart Measurement, Alia
|
||||
37 => array("NSW" => 204, "VIC" => 60, "TAS" => 1,
|
||||
"ACT" => 0, "QLD" => 130, "NT" => 1,
|
||||
"WA" => 44, "SA" => 25, "Overseas" => 18),
|
||||
//Papenmeier, Herberts Industrieglas
|
||||
65 => array("NSW" => 498, "VIC" => 537, "TAS" => 44,
|
||||
"ACT" => 0, "QLD" => 158, "NT" => 12,
|
||||
"WA" => 138, "SA" => 25, "Overseas" => 174),
|
||||
//Analytical Systems, Misc
|
||||
85 => array("NSW" => 3, "VIC" => 6, "TAS" => 0,
|
||||
"ACT" => 0, "QLD" => 1, "NT" => 0,
|
||||
"WA" => 2, "SA" => 2, "Overseas" => 0),
|
||||
//Comet, T and D.
|
||||
95 => array("NSW" => 34, "VIC" => 28, "TAS" => 6,
|
||||
"ACT" => 0, "QLD" => 29, "NT" => 0,
|
||||
"WA" => 9, "SA" => 8, "Overseas" => 31),
|
||||
);
|
||||
$stateprincipleenquiries += $stateprinciple_offset[$principle['Principle']['code']][$state['State']['shortform']];
|
||||
$stateprincipleenquiries++;
|
||||
$stateprinciple_offset = array(
|
||||
//Elmac, Amal
|
||||
15 => array("NSW" => 39, "VIC" => 38, "TAS" => 58,
|
||||
"ACT" => 0, "QLD" => 30, "NT" => 0,
|
||||
"WA" => 19, "SA" => 8, "Overseas" => 1),
|
||||
//T and B Electronic
|
||||
20 => array("NSW" => 14, "VIC" => 6, "TAS" => 0,
|
||||
"ACT" => 0, "QLD" => 8, "NT" => 0,
|
||||
"WA" => 12, "SA" => 1, "Overseas" => 5),
|
||||
//ATEX,Brilex,Marston
|
||||
25 => array("NSW" => 580, "VIC" => 599, "TAS" => 186,
|
||||
"ACT" => 0, "QLD" => 254, "NT" => 3,
|
||||
"WA" => 541, "SA" => 72, "Overseas" => 625),
|
||||
//Mid-West Instrument, DP
|
||||
35 => array("NSW" => 549, "VIC" => 851, "TAS" => 9,
|
||||
"ACT" => 0, "QLD" => 245, "NT" => 15,
|
||||
"WA" => 470, "SA" => 508, "Overseas" => 154),
|
||||
//Reading Technologies
|
||||
36 => array("NSW" => 1, "VIC" => 3, "TAS" => 0,
|
||||
"ACT" => 0, "QLD" => 7, "NT" => 0,
|
||||
"WA" => 0, "SA" => 4, "Overseas" => 2),
|
||||
//Eldridge, Smart Measurement, Alia
|
||||
37 => array("NSW" => 204, "VIC" => 60, "TAS" => 1,
|
||||
"ACT" => 0, "QLD" => 130, "NT" => 1,
|
||||
"WA" => 44, "SA" => 25, "Overseas" => 18),
|
||||
//Papenmeier, Herberts Industrieglas
|
||||
65 => array("NSW" => 498, "VIC" => 537, "TAS" => 44,
|
||||
"ACT" => 0, "QLD" => 158, "NT" => 12,
|
||||
"WA" => 138, "SA" => 25, "Overseas" => 174),
|
||||
//Analytical Systems, Misc
|
||||
85 => array("NSW" => 3, "VIC" => 6, "TAS" => 0,
|
||||
"ACT" => 0, "QLD" => 1, "NT" => 0,
|
||||
"WA" => 2, "SA" => 2, "Overseas" => 0),
|
||||
//Comet, T and D.
|
||||
95 => array("NSW" => 34, "VIC" => 28, "TAS" => 6,
|
||||
"ACT" => 0, "QLD" => 29, "NT" => 0,
|
||||
"WA" => 9, "SA" => 8, "Overseas" => 31),
|
||||
);
|
||||
$stateprincipleenquiries += $stateprinciple_offset[$principle['Principle']['code']][$state['State']['shortform']];
|
||||
$stateprincipleenquiries++;
|
||||
/* Generate/set the enquiry number */
|
||||
$enquiryno = 'CMC'.$enquiryid.$state['State']['enqform'].'E'.$principle['Principle']['code'].$principleenquiries.
|
||||
'-'.$stateprincipleenquiries;
|
||||
return $enquiryno;
|
||||
}
|
||||
|
||||
$enquiryno = 'CMC'.$enquiryid.$state['State']['enqform'].'E'.$principle['Principle']['code'].$principleenquiries.
|
||||
'-'.$stateprincipleenquiries;
|
||||
return $enquiryno;
|
||||
}
|
||||
|
||||
/* Autocomplete the customer name - Used in: add.ctp */
|
||||
function completeCustomer() {
|
||||
|
||||
$this->set('customers', $this->Enquiry->Customer->find('all', array(
|
||||
'conditions' => array(
|
||||
'Customer.name LIKE' => '%'.$this->data['Customer']['name'].'%'
|
||||
),'fields' => array('Customer.name')
|
||||
)));
|
||||
$this->layout = 'ajax';
|
||||
function completeCustomer() {
|
||||
|
||||
$this->set('customers', $this->Enquiry->Customer->find('all', array(
|
||||
'conditions' => array(
|
||||
'Customer.name LIKE' => '%'.$this->data['Customer']['name'].'%'
|
||||
),'fields' => array('Customer.name')
|
||||
)));
|
||||
$this->layout = 'ajax';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Moving this to the new Enquiry email sender. */
|
||||
function __sendNewEnquiryEmail($id) {
|
||||
|
||||
//Setup the SMTP Options
|
||||
$this->Email->smtpOptions = array(
|
||||
'port' => '25',
|
||||
'timeout' => '30',
|
||||
'host' => '192.168.0.8',
|
||||
'username' => 'sales',
|
||||
'password' => '2seng33+02');
|
||||
$this->Email->delivery = 'smtp';
|
||||
|
||||
$enquiry = $this->Enquiry->read(null, $id);
|
||||
$this->Email->to = $enquiry['Contact']['email'];
|
||||
$this->Email->cc = array($enquiry['User']['email']);
|
||||
$this->Email->bcc = array('carpis@cmctechnologies.com.au');
|
||||
|
||||
$this->Email->subject = $enquiry['Enquiry']['title'].' - Your Enquiry has been Entered in our System - CMC Technologies';
|
||||
$this->Email->replyTo = $enquiry['User']['email'];
|
||||
$this->Email->from = 'CMC Technologies - Sales <sales@cmctechnologies.com.au>';
|
||||
$this->Email->template = 'enquiry_added';
|
||||
$this->Email->sendAs = 'both';
|
||||
$this->Email->charset = 'iso-8859-1';
|
||||
$this->set('enquiry', $enquiry);
|
||||
if($this->Email->send()) {
|
||||
$this->Session->setFlash(__('The Enquiry has been added and the Contact has been emailed', true));
|
||||
$this->redirect(array('action'=>'view/'.$id), null, false);
|
||||
}
|
||||
else {
|
||||
$this->set('smtp_errors', $this->Email->smtpError);
|
||||
$this->Session->setFlash(__('The Enquiry has been added but email to the contact has NOT been sent. Something went wrong.', true));
|
||||
$this->redirect(array('action'=>'view/'.$id), null, false);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function __sendNewEnquiryEmail($id) {
|
||||
|
||||
//Setup the SMTP Options
|
||||
$this->Email->smtpOptions = array(
|
||||
'port' => '25',
|
||||
'timeout' => '30',
|
||||
'host' => '192.168.0.8',
|
||||
'username' => 'sales',
|
||||
'password' => '2seng33+02');
|
||||
$this->Email->delivery = 'smtp';
|
||||
|
||||
$enquiry = $this->Enquiry->read(null, $id);
|
||||
$this->Email->to = $enquiry['Contact']['email'];
|
||||
$this->Email->cc = array($enquiry['User']['email']);
|
||||
$this->Email->bcc = array('carpis@cmctechnologies.com.au');
|
||||
|
||||
$this->Email->subject = $enquiry['Enquiry']['title'].' - Your Enquiry has been Entered in our System - CMC Technologies';
|
||||
$this->Email->replyTo = $enquiry['User']['email'];
|
||||
$this->Email->from = 'CMC Technologies - Sales <sales@cmctechnologies.com.au>';
|
||||
$this->Email->template = 'enquiry_added';
|
||||
$this->Email->sendAs = 'both';
|
||||
$this->Email->charset = 'iso-8859-1';
|
||||
$this->set('enquiry', $enquiry);
|
||||
if($this->Email->send()) {
|
||||
$this->Session->setFlash(__('The Enquiry has been added and the Contact has been emailed', true));
|
||||
$this->redirect(array('action'=>'view/'.$id), null, false);
|
||||
}
|
||||
else {
|
||||
$this->set('smtp_errors', $this->Email->smtpError);
|
||||
$this->Session->setFlash(__('The Enquiry has been added but email to the contact has NOT been sent. Something went wrong.', true));
|
||||
$this->redirect(array('action'=>'view/'.$id), null, false);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function edit($id = null) {
|
||||
if (!$id && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid Enquiry', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if (!empty($this->data)) {
|
||||
|
||||
if ($this->Enquiry->save($this->data)) {
|
||||
$this->Session->setFlash(__('The Enquiry has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Enquiry could not be saved. Please try again.', true));
|
||||
$this->set('dump', $this->data);
|
||||
}
|
||||
}
|
||||
if (empty($this->data)) {
|
||||
$this->data = $this->Enquiry->read(null, $id);
|
||||
}
|
||||
$enquiry = $this->Enquiry->read(null, $id);
|
||||
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username')));
|
||||
//$customer = $this->Enquiry->Customer->findById($enquiry['Enquiry']['customer_id']);
|
||||
|
||||
$contacts = $this->Enquiry->Contact->find('all', array('conditions' => array('Contact.customer_id' => $enquiry['Enquiry']['customer_id'])));
|
||||
$contacts = Set::Combine($contacts, '{n}.Contact.id', array('{0} {1}', '{n}.Contact.first_name', '{n}.Contact.last_name'));
|
||||
//$state = $this->Enquiry->State->findById($enquiry['Enquiry']['state_id']);
|
||||
//$country = $this->Enquiry->Country->findById($enquiry['Enquiry']['country_id']);
|
||||
//$principle = $this->Enquiry->Principle->findById($enquiry['Enquiry']['principle_id']);
|
||||
$statuses = $this->Enquiry->Status->find('list');
|
||||
$principles = $this->Enquiry->Principle->find('list', array('conditions' => array('Principle.code' => $enquiry['Principle']['code'])));
|
||||
$customerAddresses = $this->Enquiry->BillingAddress->find('all', array('conditions'=>array('BillingAddress.customer_id' => $enquiry['Customer']['id'])));
|
||||
$this->set('billing_addresses', $customerAddresses);
|
||||
$this->set('shipping_addresses', $customerAddresses);
|
||||
|
||||
function edit($id = null) {
|
||||
if (!$id && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid Enquiry', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if (!empty($this->data)) {
|
||||
|
||||
if ($this->Enquiry->save($this->data)) {
|
||||
$this->Session->setFlash(__('The Enquiry has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Enquiry could not be saved. Please try again.', true));
|
||||
$this->set('dump', $this->data);
|
||||
}
|
||||
}
|
||||
if (empty($this->data)) {
|
||||
$this->data = $this->Enquiry->read(null, $id);
|
||||
}
|
||||
$enquiry = $this->Enquiry->read(null, $id);
|
||||
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username')));
|
||||
//$customer = $this->Enquiry->Customer->findById($enquiry['Enquiry']['customer_id']);
|
||||
|
||||
$contacts = $this->Enquiry->Contact->find('all', array('conditions' => array('Contact.customer_id' => $enquiry['Enquiry']['customer_id'])));
|
||||
$contacts = Set::Combine($contacts, '{n}.Contact.id', array('{0} {1}', '{n}.Contact.first_name', '{n}.Contact.last_name'));
|
||||
//$state = $this->Enquiry->State->findById($enquiry['Enquiry']['state_id']);
|
||||
//$country = $this->Enquiry->Country->findById($enquiry['Enquiry']['country_id']);
|
||||
//$principle = $this->Enquiry->Principle->findById($enquiry['Enquiry']['principle_id']);
|
||||
$statuses = $this->Enquiry->Status->find('list');
|
||||
$principles = $this->Enquiry->Principle->find('list', array('conditions' => array('Principle.code' => $enquiry['Principle']['code'])));
|
||||
$customerAddresses = $this->Enquiry->BillingAddress->find('all', array('conditions'=>array('BillingAddress.customer_id' => $enquiry['Customer']['id'])));
|
||||
$this->set('billing_addresses', $customerAddresses);
|
||||
$this->set('shipping_addresses', $customerAddresses);
|
||||
|
||||
/* Feels like an ugly hack. But it gets the desired effect and it will do for now */
|
||||
|
||||
if(isset($customerAddresses[0]['BillingAddress'])) {
|
||||
$billing_address_list[0] = "No Address Selected";
|
||||
foreach ($customerAddresses as $address) {
|
||||
$i = $address['BillingAddress']['id'];
|
||||
$billing_address_list[$i] = $address['BillingAddress']['address'].'<br>'.$address['BillingAddress']['city'].' '.$address['State']['name'].' '.$address['BillingAddress']['postcode'].'<br>'.up($address['Country']['name']).'<br><br>';
|
||||
}
|
||||
$this->set('billing_addresses_list', $billing_address_list);
|
||||
$this->set('shipping_addresses_list', $billing_address_list);
|
||||
}
|
||||
else {
|
||||
$this->set('billing_addresses_list', 'No Addresses exist for this Customer. Please add one');
|
||||
$this->set('shipping_addresses_list', 'No Addresses exist for this Customer. Please add one');
|
||||
}
|
||||
|
||||
|
||||
$this->set(compact('enquiry', 'users','contacts','principles','statuses', 'addresses'));
|
||||
}
|
||||
|
||||
function update_status($enquiryid) {
|
||||
$newid = $this->params['form']['value'];
|
||||
if($newid) {
|
||||
$this->Enquiry->id = $enquiryid;
|
||||
$this->Enquiry->saveField('status_id', $newid);
|
||||
$this->set('enquiry', $this->Enquiry->findById($enquiryid));
|
||||
$this->layout='ajax';
|
||||
$this->render();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function search() {
|
||||
if(empty($this->data)) {
|
||||
$this->Session->setFlash('Enter part of the Enquiry number you want to find');
|
||||
}
|
||||
if(isset($customerAddresses[0]['BillingAddress'])) {
|
||||
$billing_address_list[0] = "No Address Selected";
|
||||
foreach ($customerAddresses as $address) {
|
||||
$i = $address['BillingAddress']['id'];
|
||||
$billing_address_list[$i] = $address['BillingAddress']['address'].'<br>'.$address['BillingAddress']['city'].' '.$address['State']['name'].' '.$address['BillingAddress']['postcode'].'<br>'.up($address['Country']['name']).'<br><br>';
|
||||
}
|
||||
$this->set('billing_addresses_list', $billing_address_list);
|
||||
$this->set('shipping_addresses_list', $billing_address_list);
|
||||
}
|
||||
else {
|
||||
$this->set('billing_addresses_list', 'No Addresses exist for this Customer. Please add one');
|
||||
$this->set('shipping_addresses_list', 'No Addresses exist for this Customer. Please add one');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
$this->set(compact('enquiry', 'users','contacts','principles','statuses', 'addresses'));
|
||||
}
|
||||
|
||||
function mark_submitted($id = null) {
|
||||
if($id == null) {
|
||||
$this->Session->setFlash('Invalid Enquiry ID');
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
else {
|
||||
$this->Enquiry->id = $id;
|
||||
$today = date("Y-m-d");
|
||||
$this->Enquiry->saveField('submitted', $today);
|
||||
$this->Session->setFlash('The Enquiry has been marked as submitted today ('.date('j M Y').')');
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
/* function update_status($enquiryid) {
|
||||
$newid = $this->params['form']['value'];
|
||||
|
||||
|
||||
if($newid) {
|
||||
$this->Enquiry->id = $enquiryid;
|
||||
$this->Enquiry->saveField('status_id', $newid);
|
||||
$this->set('enquiry', $this->Enquiry->findById($enquiryid));
|
||||
$this->render('ajax');
|
||||
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
function update_status() {
|
||||
if($this->data) {
|
||||
App::import('Core', 'Sanitize');
|
||||
$new_status = Sanitize::clean($this->data['Enquiry']['status_id']);
|
||||
$this->Enquiry->id = $this->data['Enquiry']['id'];
|
||||
$this->Enquiry->saveField('status_id', $new_status);
|
||||
$this->set('enquiry', $this->Enquiry->findById($this->data['Enquiry']['id']));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function search() {
|
||||
if(empty($this->data)) {
|
||||
$this->Session->setFlash('Enter part of the Enquiry number you want to find');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function mark_submitted($id = null) {
|
||||
if($id == null) {
|
||||
$this->Session->setFlash('Invalid Enquiry ID');
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
else {
|
||||
$this->Enquiry->id = $id;
|
||||
$today = date("Y-m-d");
|
||||
$this->Enquiry->saveField('submitted', $today);
|
||||
$this->Session->setFlash('The Enquiry has been marked as submitted today ('.date('j M Y').')');
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function jsonStatus($id = null) {
|
||||
if($id == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ class LineItemsController extends AppController {
|
|||
|
||||
function index() {
|
||||
$this->LineItem->recursive = 0;
|
||||
$this->set('quoteProducts', $this->paginate());
|
||||
$this->set('lineItems', $this->paginate());
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
|
|
@ -14,7 +14,7 @@ class LineItemsController extends AppController {
|
|||
$this->Session->setFlash(__('Invalid LineItem.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$this->set('quoteProduct', $this->LineItem->read(null, $id));
|
||||
$this->set('lineItem', $this->LineItem->read(null, $id));
|
||||
}
|
||||
|
||||
function add($quoteid = null) {
|
||||
|
|
|
|||
|
|
@ -1,91 +1,94 @@
|
|||
<?php echo $javascript->link('jquery.jeditable.mini'); ?>
|
||||
|
||||
|
||||
<?php echo $paginator->options(array('url'=>$this->passedArgs)); ?>
|
||||
|
||||
<?php
|
||||
echo $paginator->counter(array(
|
||||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||
));
|
||||
?>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" class="mer">
|
||||
<tr>
|
||||
<th><?php echo $paginator->sort('user_id');?></th>
|
||||
<th><?php echo $paginator->sort('Date', 'created');?></th>
|
||||
<?php /* <th> echo $paginator->sort('Date Submitted', 'submitted'); </th> */ ?>
|
||||
<th><?php echo $paginator->sort('principle_id');?></th>
|
||||
<th><?php echo $paginator->sort('Enquiry Number', 'title');?></th>
|
||||
<th><?php echo $paginator->sort('customer_id');?></th>
|
||||
<th><?php echo $paginator->sort('contact_id');?></th>
|
||||
<th><?php __('Email'); ?></th>
|
||||
<th><?php __('Phone No'); ?></th>
|
||||
|
||||
|
||||
<th><?php echo $paginator->sort('status_id');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($enquiries as $enquiry):
|
||||
$class = null;
|
||||
//if ($i++ % 2 == 0) {
|
||||
// $class = ' class="altrow"';
|
||||
//}
|
||||
/* Set Row colour to Yellow if the Job has been won and turned into an order */
|
||||
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"';
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
echo $paginator->counter(array(
|
||||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||
));
|
||||
?>
|
||||
<tr<?php echo $class;?> id="<?php echo $i; ?>">
|
||||
<?php $nameclass = null;
|
||||
if($enquiry['Enquiry']['posted'] == 1) {
|
||||
$nameclass = ' class="posted"';
|
||||
}
|
||||
else {
|
||||
$nameclass = 'class="notposted"';
|
||||
}
|
||||
echo "<td $nameclass>";
|
||||
?>
|
||||
<?php
|
||||
|
||||
<table cellpadding="0" cellspacing="0" class="mer">
|
||||
<tr>
|
||||
<th><?php echo $paginator->sort('user_id');?></th>
|
||||
<th><?php echo $paginator->sort('Date', 'created');?></th>
|
||||
<?php /* <th> echo $paginator->sort('Date Submitted', 'submitted'); </th> */ ?>
|
||||
<th><?php echo $paginator->sort('principle_id');?></th>
|
||||
<th><?php echo $paginator->sort('Enquiry Number', 'title');?></th>
|
||||
<th><?php echo $paginator->sort('customer_id');?></th>
|
||||
<th><?php echo $paginator->sort('contact_id');?></th>
|
||||
<th><?php __('Email'); ?></th>
|
||||
<th><?php __('Phone No'); ?></th>
|
||||
|
||||
|
||||
<th><?php echo $paginator->sort('status_id');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($enquiries as $enquiry):
|
||||
$class = null;
|
||||
//if ($i++ % 2 == 0) {
|
||||
// $class = ' class="altrow"';
|
||||
//}
|
||||
/* Set Row colour to Yellow if the Job has been won and turned into an order */
|
||||
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"';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<tr<?php echo $class;?> id="row<?php echo $enquiry['Enquiry']['id']; ?>">
|
||||
<?php $nameclass = null;
|
||||
if($enquiry['Enquiry']['posted'] == 1) {
|
||||
$nameclass = ' class="posted"';
|
||||
}
|
||||
else {
|
||||
$nameclass = 'class="notposted"';
|
||||
}
|
||||
echo "<td $nameclass>";
|
||||
?>
|
||||
<?php
|
||||
/* Take the First Letter from First/Last Names to make the initials. Could be a problem if Users have the Same Initials */
|
||||
$firstname = $enquiry['User']['first_name'];
|
||||
$lastname = $enquiry['User']['last_name']; ?>
|
||||
<?php echo $html->link($firstname[0].$lastname[0], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>
|
||||
</td>
|
||||
$firstname = $enquiry['User']['first_name'];
|
||||
$lastname = $enquiry['User']['last_name']; ?>
|
||||
<?php echo $html->link($firstname[0].$lastname[0], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>
|
||||
</td>
|
||||
|
||||
<td class="enqdate">
|
||||
<?php
|
||||
<td class="enqdate">
|
||||
<?php
|
||||
/* Change the date from MySQL DATETIME to a D M Y format */
|
||||
echo date('j M Y',$time->toUnix($enquiry['Enquiry']['created'])); ?>
|
||||
</td>
|
||||
echo date('j M Y',$time->toUnix($enquiry['Enquiry']['created'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
<?php
|
||||
/* <td class="enqdate">
|
||||
|
||||
Change the date from MySQL DATETIME to a D M Y format
|
||||
|
|
@ -102,78 +105,143 @@ foreach ($enquiries as $enquiry):
|
|||
*/
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<td class="principlename">
|
||||
<?php
|
||||
if($enquiry['Principle']['short_name']) {
|
||||
echo $html->link($enquiry['Principle']['short_name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id']));
|
||||
}
|
||||
else {
|
||||
echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id']));
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($enquiry['Enquiry']['title'], array('controller'=>'enquiries', 'action'=>'view', $enquiry['Enquiry']['id'])); ?>
|
||||
</td>
|
||||
|
||||
<td class="customername">
|
||||
<?php echo $html->link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?>
|
||||
</td>
|
||||
<td class="contactname">
|
||||
<?php echo $html->link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'contacts', 'action'=>'view', $enquiry['Contact']['id'])); ?>
|
||||
</td>
|
||||
<td class="contactemail">
|
||||
<? //BCC address to Con is hardcoded in here. ?>
|
||||
<?php echo $html->link($enquiry['Contact']['email'], 'mailto:'.$enquiry['Contact']['email'].'?subject='.$enquiry['Enquiry']['title'].'&bcc=carpis@cmctechnologies.com.au'); ?>
|
||||
</td>
|
||||
<td class="contactemail">
|
||||
<?php
|
||||
if($enquiry['Contact']['mobile']) { echo 'mob:'.$enquiry['Contact']['mobile']; }
|
||||
else if($enquiry['Contact']['direct_phone']) { echo $enquiry['Contact']['direct_phone']; }
|
||||
else {
|
||||
echo $enquiry['Contact']['phone'];
|
||||
if($enquiry['Contact']['phone_extension']) {
|
||||
echo ' ext:'.$enquiry['Contact']['phone_extension'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="status"><div id="statusupdate_<?php echo $i;?>"><?php echo $enquiry['Status']['name']; ?></div>
|
||||
<?php
|
||||
echo $ajax->editor("statusupdate_$i", array('controller'=>'Enquiries', 'action'=>'update_status', $enquiry['Enquiry']['id']), array('update' => "statusupdate_$i", 'collection' => $status_list, 'okText'=>'Change Status', 'savingText' => 'Saving..', 'formId' => 'EnquiryStatusId',
|
||||
'formClassName' => 'MER-inplace-select'));
|
||||
?>
|
||||
</td>
|
||||
<td class="comments">
|
||||
<div id="comment_<?php echo $i; ?>">
|
||||
<?php
|
||||
|
||||
$displayedComment = substr($enquiry['Enquiry']['comments'], 0, 60);
|
||||
echo $displayedComment;
|
||||
if(strlen($enquiry['Enquiry']['comments']) > strlen($displayedComment) ) {
|
||||
echo '.... '.$html->link('view all', array('controller'=>'enquiries', 'action'=>'view', $enquiry['Enquiry']['id']));
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="viewedit">
|
||||
<?php echo $html->link(__('View', true), array('controller'=>'enquiries','action'=>'view', $enquiry['Enquiry']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=>'enquiries','action'=>'edit', $enquiry['Enquiry']['id'])); ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i++; ?>
|
||||
<?php endforeach; ?>
|
||||
<td class="principlename">
|
||||
<?php
|
||||
if($enquiry['Principle']['short_name']) {
|
||||
echo $html->link($enquiry['Principle']['short_name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id']));
|
||||
}
|
||||
else {
|
||||
echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id']));
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($enquiry['Enquiry']['title'], array('controller'=>'enquiries', 'action'=>'view', $enquiry['Enquiry']['id'])); ?>
|
||||
</td>
|
||||
|
||||
<td class="customername">
|
||||
<?php echo $html->link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?>
|
||||
</td>
|
||||
<td class="contactname">
|
||||
<?php echo $html->link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'contacts', 'action'=>'view', $enquiry['Contact']['id'])); ?>
|
||||
</td>
|
||||
<td class="contactemail">
|
||||
<? //BCC address to Con is hardcoded in here. ?>
|
||||
<?php echo $html->link($enquiry['Contact']['email'], 'mailto:'.$enquiry['Contact']['email'].'?subject='.$enquiry['Enquiry']['title'].'&bcc=carpis@cmctechnologies.com.au'); ?>
|
||||
</td>
|
||||
<td class="contactemail">
|
||||
<?php
|
||||
if($enquiry['Contact']['mobile']) { echo 'mob:'.$enquiry['Contact']['mobile']; }
|
||||
else if($enquiry['Contact']['direct_phone']) { echo $enquiry['Contact']['direct_phone']; }
|
||||
else {
|
||||
echo $enquiry['Contact']['phone'];
|
||||
if($enquiry['Contact']['phone_extension']) {
|
||||
echo ' ext:'.$enquiry['Contact']['phone_extension'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="status"><div id="<? echo $enquiry['Enquiry']['id']; ?>"><?php echo $enquiry['Status']['name']; ?></div>
|
||||
<?php
|
||||
$enqid = $enquiry['Enquiry']['id'];
|
||||
|
||||
$statusList = $status_list;
|
||||
|
||||
$statusList['selected'] = $enquiry['Enquiry']['status_id'];
|
||||
|
||||
$jsonList = json_encode($statusList);
|
||||
|
||||
$jsblock = <<<ENDJS
|
||||
|
||||
|
||||
\$('#$enqid').editable('update_status', {
|
||||
id : 'data[Enquiry][id]',
|
||||
name: 'data[Enquiry][status_id]',
|
||||
|
||||
data : '$jsonList',
|
||||
type : 'select',
|
||||
indicator : 'Saving...',
|
||||
submit : 'Update Status',
|
||||
callback : function(value, settings) {
|
||||
|
||||
var match = /won/i.test(value);
|
||||
|
||||
if(match == true) {
|
||||
\$('#row$enqid').removeClass().addClass('jobwon');
|
||||
return;
|
||||
}
|
||||
|
||||
match = /lost/i.test(value);
|
||||
|
||||
if(match == true) {
|
||||
\$('#row$enqid').removeClass().addClass('joblost');
|
||||
return;
|
||||
}
|
||||
|
||||
match = /cancelled/i.test(value);
|
||||
|
||||
if(match == true) {
|
||||
\$('#row$enqid').removeClass().addClass('joblost');
|
||||
return;
|
||||
}
|
||||
|
||||
match = /information sent/i.test(value);
|
||||
if(match == true) {
|
||||
\$('#row$enqid').removeClass().addClass('informationsent');
|
||||
return;
|
||||
}
|
||||
|
||||
match = /issued/i.test(value);
|
||||
if(match == true) {
|
||||
\$('#row$enqid').removeClass().addClass('quoted');
|
||||
return;
|
||||
}
|
||||
|
||||
match = /request for quotation/i.test(value);
|
||||
if(match == true) {
|
||||
\$('#row$enqid').removeClass().addClass('requestforquote');
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ENDJS;
|
||||
|
||||
echo $javascript->codeBlock($jsblock);
|
||||
?>
|
||||
</td>
|
||||
<td class="comments">
|
||||
<div id="comment_<?php echo $i; ?>">
|
||||
<?php
|
||||
|
||||
$displayedComment = substr($enquiry['Enquiry']['comments'], 0, 60);
|
||||
echo $displayedComment;
|
||||
if(strlen($enquiry['Enquiry']['comments']) > strlen($displayedComment) ) {
|
||||
echo '.... '.$html->link('view all', array('controller'=>'enquiries', 'action'=>'view', $enquiry['Enquiry']['id']));
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="viewedit">
|
||||
<?php echo $html->link(__('View', true), array('controller'=>'enquiries','action'=>'view', $enquiry['Enquiry']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=>'enquiries','action'=>'edit', $enquiry['Enquiry']['id'])); ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i++; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<div class="paging">
|
||||
|
||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||
| <?php echo $paginator->numbers();?>
|
||||
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
|
||||
|
||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||
| <?php echo $paginator->numbers();?>
|
||||
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<?php echo $enquiry['Status']['name']; ?>
|
||||
<?php echo $enquiry['Status']['name']; ?>
|
||||
|
|
@ -1,85 +1,29 @@
|
|||
<div class="quoteProducts form">
|
||||
<div class="lineItems form">
|
||||
<?php echo $form->create('LineItem');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Add Product to this Quote');?></legend>
|
||||
<?php
|
||||
|
||||
echo $form->input('quote_id', array('type' => 'hidden', 'value' => $quote['Quote']['id']));
|
||||
|
||||
|
||||
echo $form->input('quantity', array('class' => 'required validate-number', 'title'=>'Please enter the quantity. It must be a number'));
|
||||
|
||||
echo $form->input('option', array('label' => 'This item is optional'));
|
||||
|
||||
echo $form->input('principle_id', array('empty' => 'Select a Principle'));
|
||||
echo $ajax->observeField('LineItemPrincipleId', array(
|
||||
'url' => 'principle_products',
|
||||
'frequency' => 0.2,
|
||||
'update' => 'products'
|
||||
));
|
||||
|
||||
|
||||
echo $form->input('product_id', array('type' => 'select', 'id'=>'products'));
|
||||
|
||||
|
||||
|
||||
echo $ajax->observeField('products', array(
|
||||
|
||||
'url' => 'product_options',
|
||||
'frequency' => 0.2,
|
||||
'update' => 'productoptions'
|
||||
));
|
||||
|
||||
|
||||
echo $ajax->div('productoptions');
|
||||
echo $ajax->divEnd('productoptions');
|
||||
|
||||
|
||||
|
||||
|
||||
//echo '<div id="productoptions"></div>';
|
||||
//echo $form->select('QuoteProduct.product_id', null, null, array('id'=>'products'));
|
||||
//*/
|
||||
|
||||
/*
|
||||
<legend><?php __('Add LineItem');?></legend>
|
||||
<?php
|
||||
echo $form->input('item_number');
|
||||
echo $form->input('option');
|
||||
echo $form->input('quantity');
|
||||
echo $form->input('cost_price');
|
||||
echo $form->input('currency_id');
|
||||
echo $form->input('our_discount');
|
||||
echo $form->input('packing');
|
||||
echo $form->input('shipping_weight');
|
||||
echo $form->input('shipping_cost');
|
||||
echo $form->input('exchange_rate');
|
||||
echo $form->input('duty');
|
||||
echo $form->input('finance');
|
||||
echo $form->input('misc');
|
||||
echo $form->input('gross_sell_price');
|
||||
echo $form->input('target_gp');
|
||||
echo $form->input('title');
|
||||
echo $form->input('description');
|
||||
echo $form->input('quote_id');
|
||||
echo $form->input('product_id');
|
||||
echo $form->input('discount');
|
||||
*/
|
||||
|
||||
?>
|
||||
echo $form->input('costing_id');
|
||||
echo $form->input('unit_price');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');
|
||||
echo $javascript->codeBlock("new Validation('QuoteProductAddForm', {immediate : true, useTitles : true});", array('allowCache'=>true, 'safe'=>false));
|
||||
|
||||
|
||||
?>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('List QuoteProducts', true), array('action' => 'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List LineItems', true), array('action' => 'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Costings', true), array('controller' => 'costings', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Costing', true), array('controller' => 'costings', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,42 +1,31 @@
|
|||
<div class="quoteProducts form">
|
||||
<?php echo $form->create('QuoteProduct');?>
|
||||
<div class="lineItems form">
|
||||
<?php echo $form->create('LineItem');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Edit QuoteProduct');?></legend>
|
||||
<legend><?php __('Edit LineItem');?></legend>
|
||||
<?php
|
||||
echo $form->input('id');
|
||||
echo $form->input('item_number');
|
||||
echo $form->input('option');
|
||||
echo $form->input('quantity');
|
||||
echo $form->input('cost_price');
|
||||
echo $form->input('currency_id');
|
||||
echo $form->input('our_discount');
|
||||
echo $form->input('packing');
|
||||
echo $form->input('shipping_weight');
|
||||
echo $form->input('shipping_cost');
|
||||
echo $form->input('exchange_rate');
|
||||
echo $form->input('duty');
|
||||
echo $form->input('finance');
|
||||
echo $form->input('misc');
|
||||
echo $form->input('gross_sell_price');
|
||||
echo $form->input('target_gp');
|
||||
echo $form->input('title');
|
||||
echo $form->input('description');
|
||||
echo $form->input('quote_id');
|
||||
echo $form->input('product_id');
|
||||
echo $form->input('discount');
|
||||
echo $form->input('costing_id');
|
||||
echo $form->input('unit_price');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('QuoteProduct.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('QuoteProduct.id'))); ?></li>
|
||||
<li><?php echo $html->link(__('List QuoteProducts', true), array('action' => 'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('LineItem.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('LineItem.id'))); ?></li>
|
||||
<li><?php echo $html->link(__('List LineItems', true), array('action' => 'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Costings', true), array('controller' => 'costings', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Costing', true), array('controller' => 'costings', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="quoteProducts index">
|
||||
<h2><?php __('QuoteProducts');?></h2>
|
||||
<div class="lineItems index">
|
||||
<h2><?php __('LineItems');?></h2>
|
||||
<p>
|
||||
<?php
|
||||
echo $paginator->counter(array(
|
||||
|
|
@ -17,11 +17,12 @@ echo $paginator->counter(array(
|
|||
<th><?php echo $paginator->sort('quote_id');?></th>
|
||||
<th><?php echo $paginator->sort('product_id');?></th>
|
||||
<th><?php echo $paginator->sort('costing_id');?></th>
|
||||
<th><?php echo $paginator->sort('unit_price');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($quoteProducts as $quoteProduct):
|
||||
foreach ($lineItems as $lineItem):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
|
|
@ -29,36 +30,39 @@ foreach ($quoteProducts as $quoteProduct):
|
|||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td>
|
||||
<?php echo $quoteProduct['QuoteProduct']['id']; ?>
|
||||
<?php echo $lineItem['LineItem']['id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $quoteProduct['QuoteProduct']['item_number']; ?>
|
||||
<?php echo $lineItem['LineItem']['item_number']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $quoteProduct['QuoteProduct']['option']; ?>
|
||||
<?php echo $lineItem['LineItem']['option']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $quoteProduct['QuoteProduct']['quantity']; ?>
|
||||
<?php echo $lineItem['LineItem']['quantity']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $quoteProduct['QuoteProduct']['title']; ?>
|
||||
<?php echo $lineItem['LineItem']['title']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $quoteProduct['QuoteProduct']['description']; ?>
|
||||
<?php echo $lineItem['LineItem']['description']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($quoteProduct['Quote']['id'], array('controller' => 'quotes', 'action' => 'view', $quoteProduct['Quote']['id'])); ?>
|
||||
<?php echo $html->link($lineItem['Quote']['id'], array('controller' => 'quotes', 'action' => 'view', $lineItem['Quote']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($quoteProduct['Product']['title'], array('controller' => 'products', 'action' => 'view', $quoteProduct['Product']['id'])); ?>
|
||||
<?php echo $html->link($lineItem['Product']['title'], array('controller' => 'products', 'action' => 'view', $lineItem['Product']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $quoteProduct['QuoteProduct']['costing_id']; ?>
|
||||
<?php echo $lineItem['LineItem']['costing_id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['unit_price']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('action' => 'view', $quoteProduct['QuoteProduct']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $quoteProduct['QuoteProduct']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $quoteProduct['QuoteProduct']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quoteProduct['QuoteProduct']['id'])); ?>
|
||||
<?php echo $html->link(__('View', true), array('action' => 'view', $lineItem['LineItem']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $lineItem['LineItem']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $lineItem['LineItem']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $lineItem['LineItem']['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
|
@ -71,9 +75,7 @@ foreach ($quoteProducts as $quoteProduct):
|
|||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New QuoteProduct', true), array('action' => 'add')); ?></li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('New LineItem', true), array('action' => 'add')); ?></li>
|
||||
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ foreach ($options as $opt) {
|
|||
|
||||
if($prodopt['default'] == 1) {
|
||||
$default_option = $prodopt['id'];
|
||||
|
||||
$drop_options[$prodopt['id']] .= " (Default)";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,61 +1,64 @@
|
|||
<div class="quoteProducts view">
|
||||
<h2><?php __('QuoteProduct');?></h2>
|
||||
<div class="lineItems view">
|
||||
<h2><?php __('LineItem');?></h2>
|
||||
<dl><?php $i = 0; $class = ' class="altrow"';?>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['QuoteProduct']['id']; ?>
|
||||
<?php echo $lineItem['LineItem']['id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Item Number'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['QuoteProduct']['item_number']; ?>
|
||||
<?php echo $lineItem['LineItem']['item_number']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Option'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['QuoteProduct']['option']; ?>
|
||||
<?php echo $lineItem['LineItem']['option']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quantity'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['QuoteProduct']['quantity']; ?>
|
||||
<?php echo $lineItem['LineItem']['quantity']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Title'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['QuoteProduct']['title']; ?>
|
||||
<?php echo $lineItem['LineItem']['title']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Description'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['QuoteProduct']['description']; ?>
|
||||
<?php echo $lineItem['LineItem']['description']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quote'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($quoteProduct['Quote']['id'], array('controller' => 'quotes', 'action' => 'view', $quoteProduct['Quote']['id'])); ?>
|
||||
<?php echo $html->link($lineItem['Quote']['id'], array('controller' => 'quotes', 'action' => 'view', $lineItem['Quote']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Product'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($quoteProduct['Product']['title'], array('controller' => 'products', 'action' => 'view', $quoteProduct['Product']['id'])); ?>
|
||||
<?php echo $html->link($lineItem['Product']['title'], array('controller' => 'products', 'action' => 'view', $lineItem['Product']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Costing Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['QuoteProduct']['costing_id']; ?>
|
||||
<?php echo $lineItem['LineItem']['costing_id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Unit Price'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['LineItem']['unit_price']; ?>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit QuoteProduct', true), array('action' => 'edit', $quoteProduct['QuoteProduct']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('Delete QuoteProduct', true), array('action' => 'delete', $quoteProduct['QuoteProduct']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quoteProduct['QuoteProduct']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('List QuoteProducts', true), array('action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New QuoteProduct', true), array('action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('Edit LineItem', true), array('action' => 'edit', $lineItem['LineItem']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('Delete LineItem', true), array('action' => 'delete', $lineItem['LineItem']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $lineItem['LineItem']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('List LineItems', true), array('action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New LineItem', true), array('action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
|
||||
|
|
@ -66,97 +69,133 @@
|
|||
</div>
|
||||
<div class="related">
|
||||
<h3><?php __('Related Costings');?></h3>
|
||||
<?php if (!empty($quoteProduct['Costing'])):?>
|
||||
<?php if (!empty($lineItem['Costing'])):?>
|
||||
<dl> <?php $i = 0; $class = ' class="altrow"';?>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['id'];?>
|
||||
<?php echo $lineItem['Costing']['id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['created'];?>
|
||||
<?php echo $lineItem['Costing']['created'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Product Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['product_id'];?>
|
||||
<?php echo $lineItem['Costing']['product_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quote Product Id');?></dt>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Line Item Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['quote_product_id'];?>
|
||||
<?php echo $lineItem['Costing']['line_item_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Order Product Id');?></dt>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Purchase Currency Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['order_product_id'];?>
|
||||
<?php echo $lineItem['Costing']['purchase_currency_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Invoice Product Id');?></dt>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Sale Currency Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['invoice_product_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Currency Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['currency_id'];?>
|
||||
<?php echo $lineItem['Costing']['sale_currency_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quantity');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['quantity'];?>
|
||||
<?php echo $lineItem['Costing']['quantity'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Unit Cost Price');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['unit_cost_price'];?>
|
||||
<?php echo $lineItem['Costing']['unit_cost_price'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Exchange Rate');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['exchange_rate'];?>
|
||||
<?php echo $lineItem['Costing']['exchange_rate'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Our Discount Percent');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['our_discount_percent'];?>
|
||||
<?php echo $lineItem['Costing']['our_discount_percent'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Packing');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['packing'];?>
|
||||
<?php echo $lineItem['Costing']['packing'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Fob Sale Currency');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['fob_sale_currency'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipping Weight');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['shipping_weight'];?>
|
||||
<?php echo $lineItem['Costing']['shipping_weight'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipping Cost');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['shipping_cost'];?>
|
||||
<?php echo $lineItem['Costing']['shipping_cost'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Duty Percent');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['duty_percent'];?>
|
||||
<?php echo $lineItem['Costing']['duty_percent'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Duty Percent Amount');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['duty_percent_amount'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customs');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['customs'];?>
|
||||
<?php echo $lineItem['Costing']['customs'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Finance Percent');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['finance_percent'];?>
|
||||
<?php echo $lineItem['Costing']['finance_percent'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Finance Percent Amount');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['finance_percent_amount'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Misc Costs');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['misc_costs'];?>
|
||||
<?php echo $lineItem['Costing']['misc_costs'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Total Landed Cost');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['total_landed_cost'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Gross Sell Price');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['gross_sell_price'];?>
|
||||
<?php echo $lineItem['Costing']['gross_sell_price'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Sale Discount Percent');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['sale_discount_percent'];?>
|
||||
<?php echo $lineItem['Costing']['sale_discount_percent'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Net Sell Price');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $quoteProduct['Costing']['net_sell_price'];?>
|
||||
<?php echo $lineItem['Costing']['net_sell_price'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Sale Discount Amount');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['sale_discount_amount'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Gross Gp Prior To Discount');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['gross_gp_prior_to_discount'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Net Gp Percent');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['net_gp_percent'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Net Gp Amount');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['net_gp_amount'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Gross Sell Price Each');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['gross_sell_price_each'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Net Sell Price Each');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['net_sell_price_each'];?>
|
||||
</dd>
|
||||
</dl>
|
||||
<?php endif; ?>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit Costing', true), array('controller' => 'costings', 'action' => 'edit', $quoteProduct['Costing']['id'])); ?></li>
|
||||
<li><?php echo $html->link(__('Edit Costing', true), array('controller' => 'costings', 'action' => 'edit', $lineItem['Costing']['id'])); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -106,9 +106,9 @@ foreach ($quote['QuotePage'] as $quotePage):
|
|||
echo $quote['Currency']['symbol'].$thisNetPrice; ?></td>
|
||||
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'quote_products', 'action'=>'view', $quoteProduct['LineItem']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=> 'quote_products', 'action'=>'edit', $quoteProduct['LineItem']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller'=> 'quote_products', 'action'=>'delete', $quoteProduct['LineItem']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quoteProduct['LineItem']['id'])); ?>
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'line_items', 'action'=>'view', $quoteProduct['LineItem']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=> 'line_items', 'action'=>'edit', $quoteProduct['LineItem']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller'=> 'line_items', 'action'=>'delete', $quoteProduct['LineItem']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quoteProduct['LineItem']['id'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,6 @@ function buildup() {
|
|||
var netGPamount = grossGP - saleDiscountAmount;
|
||||
netGPamount = netGPamount.toFixed(2);
|
||||
$("#CostingNetGpAmount").val(netGPamount);
|
||||
|
||||
//Calculate net GP %
|
||||
var netGPpercent = (netGPamount / grossSellPrice) * 100;
|
||||
netGPpercent = netGPpercent.toFixed(2);
|
||||
|
|
|
|||
Loading…
Reference in a new issue