FUCK YEAH
This commit is contained in:
parent
f691abc6db
commit
d75eeb28de
|
|
@ -5,38 +5,38 @@ class DocumentsController extends AppController {
|
|||
var $helpers = array('Html', 'Form');
|
||||
|
||||
function index() {
|
||||
$this->Document->recursive = 0;
|
||||
$this->set('documents', $this->paginate());
|
||||
$this->Document->recursive = 0;
|
||||
$this->set('documents', $this->paginate());
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid Document.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$document = $this->Document->read(null, $id);
|
||||
$this->set('document', $document);
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid Document.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$document = $this->Document->read(null, $id);
|
||||
$this->set('document', $document);
|
||||
|
||||
|
||||
|
||||
$docType = "";
|
||||
$docType = "";
|
||||
|
||||
if(!empty($document['Invoice']['id'])) {
|
||||
$docType = "invoice";
|
||||
}
|
||||
elseif(!empty($document['Quote']['id'])) {
|
||||
$docType = "quote";
|
||||
if(!empty($document['Invoice']['id'])) {
|
||||
$docType = "invoice";
|
||||
}
|
||||
elseif(!empty($document['Quote']['id'])) {
|
||||
$docType = "quote";
|
||||
$enquiry = $this->Document->Quote->Enquiry->read(null, $document['Quote']['enquiry_id']);
|
||||
$this->set('enquiry',$enquiry);
|
||||
|
||||
}
|
||||
elseif(!empty($document['PurchaseOrder']['id'])) {
|
||||
$docType = "purchaseOrder";
|
||||
}
|
||||
}
|
||||
elseif(!empty($document['PurchaseOrder']['id'])) {
|
||||
$docType = "purchaseOrder";
|
||||
}
|
||||
|
||||
$this->data = $document;
|
||||
$this->data = $document;
|
||||
$this->set('docType',$docType);
|
||||
$this->set('principles', $this->Document->LineItem->Product->Principle->find('list'));
|
||||
// $this->set('principles', $this->Document->LineItem->Product->Principle->find('list'));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -48,6 +48,26 @@ class DocumentsController extends AppController {
|
|||
if($principleID == null) {
|
||||
echo "INVALID PRINCIPLE ID";
|
||||
}
|
||||
else {
|
||||
$products = $this->Document->LineItem->Product->find('list', array('conditions'=>array('Product.principle_id'=>$principleID)));
|
||||
$this->set('products',$products);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a JSON object of the Product.
|
||||
*/
|
||||
function getProductDetails($productID = null) {
|
||||
$this->layout = 'ajax';
|
||||
|
||||
if($productID == null) {
|
||||
echo "INVALID PRODUCT ID";
|
||||
}
|
||||
else {
|
||||
$product = $this->Document->LineItem->Product->find('first',array('conditions'=>array('Product.id'=>$productID)));
|
||||
$this->set('product',$product);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -55,30 +75,30 @@ class DocumentsController extends AppController {
|
|||
* @param int $id - the Enquiry ID that this quote belongs to.
|
||||
*/
|
||||
function newQuote($id = null) {
|
||||
$enquiryid = $id;
|
||||
$this->Document->create();
|
||||
$enquiryid = $id;
|
||||
$this->Document->create();
|
||||
|
||||
$enquiry = $this->Document->Quote->Enquiry->findById($id);
|
||||
$enquiry = $this->Document->Quote->Enquiry->findById($id);
|
||||
|
||||
$this->data['Document']['enquiry_id'] = $enquiryid;
|
||||
$this->data['Document']['enquiry_id'] = $enquiryid;
|
||||
|
||||
$this->data['Quote']['enquiry_id'] = $enquiryid;
|
||||
$number_of_revisions = $this->Document->Quote->findCount('Quote.enquiry_id ='. $enquiryid);
|
||||
$this->data['Quote']['revision'] = $number_of_revisions;
|
||||
$this->data['Quote']['enquiry_id'] = $enquiryid;
|
||||
$number_of_revisions = $this->Document->Quote->findCount('Quote.enquiry_id ='. $enquiryid);
|
||||
$this->data['Quote']['revision'] = $number_of_revisions;
|
||||
|
||||
$this->data['Document']['user_id']= $enquiry['Enquiry']['user_id'];
|
||||
|
||||
|
||||
$this->data['Document']['user_id']= $enquiry['Enquiry']['user_id'];
|
||||
|
||||
|
||||
if ($this->Document->saveAll($this->data)) {
|
||||
$newid = $this->Document->id;
|
||||
|
||||
$this->Session->setFlash(__('The Document has been saved', true));
|
||||
$this->redirect(array('action'=>'view',$newid));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Document could not be saved. Please, try again.', true));
|
||||
}
|
||||
|
||||
if ($this->Document->saveAll($this->data)) {
|
||||
$newid = $this->Document->id;
|
||||
|
||||
$this->Session->setFlash(__('The Document has been saved', true));
|
||||
$this->redirect(array('action'=>'view',$newid));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Document could not be saved. Please, try again.', true));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -90,36 +110,36 @@ class DocumentsController extends AppController {
|
|||
* @param int $id - the Enquiry ID that this quote belongs to.
|
||||
*/
|
||||
function newInvoice($id = null) {
|
||||
$enquiryid = $id;
|
||||
$this->Document->create();
|
||||
$enquiryid = $id;
|
||||
$this->Document->create();
|
||||
|
||||
$enquiry = $this->Document->Enquiry->findById($id);
|
||||
$enquiry = $this->Document->Enquiry->findById($id);
|
||||
|
||||
$this->data['Document']['enquiry_id'] = $enquiryid;
|
||||
$this->data['Document']['enquiry_id'] = $enquiryid;
|
||||
|
||||
$this->data['Invoice']['enquiry_id'] = $enquiryid;
|
||||
$invoice_number_offset = 4436; //What Invoice number we were up to before the new system.
|
||||
$number_of_invoices = $this->Document->Invoice->findCount();
|
||||
$this->data['Invoice']['enquiry_id'] = $enquiryid;
|
||||
$invoice_number_offset = 4436; //What Invoice number we were up to before the new system.
|
||||
$number_of_invoices = $this->Document->Invoice->findCount();
|
||||
|
||||
$newInvoiceNumber = $invoice_number_offset + $number_of_invoices;
|
||||
$newInvoiceNumber = $invoice_number_offset + $number_of_invoices;
|
||||
|
||||
$this->data['Invoice']['title'] = "CMCIN".$newInvoiceNumber;
|
||||
$this->data['Invoice']['title'] = "CMCIN".$newInvoiceNumber;
|
||||
|
||||
|
||||
$this->data['Document']['customer_id'] = $enquiry['Enquiry']['customer_id'];
|
||||
$this->data['Document']['user_id']= $enquiry['Enquiry']['user_id'];
|
||||
$this->data['Document']['contact_id']= $enquiry['Enquiry']['contact_id'];
|
||||
$this->data['Page'][0]['page_number'] = 1;
|
||||
$this->data['Page'][0]['contentPage'] = 0;
|
||||
$this->data['Document']['customer_id'] = $enquiry['Enquiry']['customer_id'];
|
||||
$this->data['Document']['user_id']= $enquiry['Enquiry']['user_id'];
|
||||
$this->data['Document']['contact_id']= $enquiry['Enquiry']['contact_id'];
|
||||
$this->data['Page'][0]['page_number'] = 1;
|
||||
$this->data['Page'][0]['contentPage'] = 0;
|
||||
|
||||
if ($this->Document->saveAll($this->data)) {
|
||||
$newid = $this->Document->id;
|
||||
if ($this->Document->saveAll($this->data)) {
|
||||
$newid = $this->Document->id;
|
||||
|
||||
$this->Session->setFlash(__('The Document has been saved', true));
|
||||
$this->redirect(array('action'=>'view',$newid));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Document could not be saved. Please, try again.', true));
|
||||
}
|
||||
$this->Session->setFlash(__('The Document has been saved', true));
|
||||
$this->redirect(array('action'=>'view',$newid));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Document could not be saved. Please, try again.', true));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -129,27 +149,50 @@ class DocumentsController extends AppController {
|
|||
|
||||
|
||||
function edit($id = null) {
|
||||
if (!$id && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid Document', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if (!empty($this->data)) {
|
||||
if (!$id && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid Document', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if (!empty($this->data)) {
|
||||
$docID = $this->data['Document']['id'];
|
||||
|
||||
$this->Document->DocPage->deleteAll(array('document_id'=>$docID));
|
||||
|
||||
$this->Document->DocPage->updateCounterCache(array('document_id'=>$docID));
|
||||
if ($this->Document->saveAll($this->data)) {
|
||||
$this->Session->setFlash(__('The Document has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Document could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
if (empty($this->data)) {
|
||||
$this->data = $this->Document->read(null, $id);
|
||||
}
|
||||
|
||||
if ($this->Document->saveAll($this->data)) {
|
||||
$this->Session->setFlash(__('The Document has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Document could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
if (empty($this->data)) {
|
||||
$this->data = $this->Document->read(null, $id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function ajax_edit($id=null) {
|
||||
$this->layout = 'ajax';
|
||||
|
||||
if (!$id && empty($this->data)) {
|
||||
echo 'Invalid Document ID';
|
||||
}
|
||||
if (!empty($this->data)) {
|
||||
$docID = $this->data['Document']['id'];
|
||||
$this->Document->DocPage->deleteAll(array('document_id'=>$docID));
|
||||
$this->Document->DocPage->updateCounterCache(array('document_id'=>$docID));
|
||||
|
||||
|
||||
if ($this->Document->saveAll($this->data)) {
|
||||
echo 'SUCCESS';
|
||||
} else {
|
||||
echo 'FAILURE';
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo 'FAILURE';
|
||||
}
|
||||
}
|
||||
|
||||
/*function delete($id = null) {
|
||||
|
|
|
|||
|
|
@ -6,191 +6,51 @@ class LineItemsController extends AppController {
|
|||
|
||||
var $components = array('RequestHandler');
|
||||
|
||||
function index() {
|
||||
$this->LineItem->recursive = 0;
|
||||
$this->set('lineItems', $this->paginate());
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid LineItem.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$this->set('lineItem', $this->LineItem->read(null, $id));
|
||||
}
|
||||
|
||||
function add($documentID = null) {
|
||||
function ajax_add() {
|
||||
$this->layout = 'ajax';
|
||||
if (!$documentID && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid Document ID', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if(!empty($this->data)) {
|
||||
$this->LineItem->create($this->data);
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$this->LineItem->create();
|
||||
|
||||
if ($this->LineItem->save($this->data)) {
|
||||
$documentID = $this->data['LineItem']['document_id'];
|
||||
|
||||
$this->Session->setFlash(__('Product Added to Quote Successfully', true));
|
||||
$this->redirect(array('controller'=>'documents', 'action'=>'view', $documentID));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The LineItem could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$principles = $this->LineItem->Product->Principle->find('list');
|
||||
$products = $this->LineItem->Product->find('list');
|
||||
|
||||
$this->set(compact('principles', 'products'));
|
||||
if ($this->LineItem->saveAll($this->data)) {
|
||||
echo "SUCCESS";
|
||||
}
|
||||
else {
|
||||
echo "FAILURE";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "NO-DATA";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Process the Line Item and add it to a quote */
|
||||
function ajaxSave() {
|
||||
|
||||
|
||||
if($this->RequestHandler->isAjax()) {
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$this->LineItem->create();
|
||||
|
||||
if(isset($this->data['LineItem']['product_id'])) {
|
||||
$product = $this->LineItem->Product->findById($this->data['LineItem']['product_id']);
|
||||
|
||||
/* Copy all the data from the Product to the new LineItem */
|
||||
|
||||
$this->data['LineItem']['description'] = $product['Product']['description'];
|
||||
|
||||
|
||||
|
||||
$this->data['LineItem']['title'] = $product['Product']['title'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if($this->LineItem->save($this->data)) {
|
||||
echo 'success';
|
||||
}
|
||||
else {
|
||||
echo 'failure';
|
||||
}
|
||||
Configure::write('debug', 0);
|
||||
$this->autoRender = false;
|
||||
exit();
|
||||
|
||||
|
||||
/* Need to find a way to append Product Option data to the description / model number title */
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getTable($documentID = null) {
|
||||
$this->layout = 'ajax';
|
||||
if($documentID == null) {
|
||||
echo "INVALID DOCUMENT ID";
|
||||
}
|
||||
else {
|
||||
$document = $this->LineItem->Document->find('first',array('conditions'=>array('Document.id'=>$documentID)));
|
||||
$this->set('document',$document);
|
||||
|
||||
$currencies = $this->LineItem->Document->Quote->Currency->find('list', array('fields'=>array('Currency.id','Currency.iso4217')));
|
||||
$this->set('currencies',$currencies);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Display a list of Products for a given principle. Used for the add() method */
|
||||
function principle_products() {
|
||||
if (empty($this->data['LineItem']['principle_id'])) {
|
||||
}
|
||||
else {
|
||||
$this->set('products', $this->LineItem->Product->find('list', array('conditions'=>array('Product.principle_id'=>$this->data['LineItem']['principle_id']))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Display a list of Options (if any) for a given Product. Used for the add() method */
|
||||
function product_options() {
|
||||
|
||||
/*$this->set('categories', $this->LineItem->Product->ProductOptionsCategory->find('list'),
|
||||
array('conditions' => array('ProductOptionsCategory.product_id'=>$this->data['LineItem']['product_id']),
|
||||
'order'=>'ProductOptionsCategory.location ASC') );*/
|
||||
|
||||
$this->set('options', $this->LineItem->Product->ProductOptionsCategory->find('all',
|
||||
array('conditions' => array('ProductOptionsCategory.product_id'=>$this->data['LineItem']['product_id']),
|
||||
'order'=>'ProductOptionsCategory.location ASC')));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function edit($id = null) {
|
||||
|
||||
|
||||
if (!$id && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid LineItem', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!empty($this->data)) {
|
||||
if ($this->LineItem->save($this->data)) {
|
||||
$this->Session->setFlash(__('The LineItem has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The LineItem could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
if (empty($this->data)) {
|
||||
$this->data = $this->LineItem->read(null, $id);
|
||||
}
|
||||
|
||||
$quotes = $this->LineItem->Quote->find('list');
|
||||
$products = $this->LineItem->Product->find('list');
|
||||
$this->set(compact('quotes','products'));
|
||||
}
|
||||
|
||||
function delete($id = null) {
|
||||
|
||||
$thisQP = $this->LineItem->read(null, $id);
|
||||
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid id for LineItem', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if ($this->LineItem->del($id)) {
|
||||
$this->Session->setFlash(__('LineItem deleted', true));
|
||||
$this->redirect(array('controller'=>'quotes', 'action'=>'view/'.$thisQP['Quote']['id']));
|
||||
}
|
||||
function add($documentID = null) {
|
||||
$document = $this->LineItem->Document->read(null, $documentID);
|
||||
$this->set('document', $document);
|
||||
$this->set('principles', $this->LineItem->Product->Principle->find('list'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
function viewTable() {
|
||||
|
||||
|
||||
if($this->RequestHandler->isAjax()) {
|
||||
if (!empty($this->data)) {
|
||||
if($this->data['LineItem']['quote_id'] != null) {
|
||||
$quoteid = $this->data['LineItem']['quote_id'];
|
||||
|
||||
$lineItems = $this->LineItem->find('all', array('recursive' => 0, 'conditions' => array('LineItem.quote_id' => $quoteid),
|
||||
'order' => array('LineItem.item_number ASC'))
|
||||
);
|
||||
|
||||
$quote = $this->LineItem->Quote->read(null, $quoteid);
|
||||
$this->set('quote', $quote);
|
||||
|
||||
$this->set('lineItems', $lineItems);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//Was POSTed with no data.
|
||||
$this->set('lineItems', 'Something has broken. Requesting a LineItem table without POSTing a quote or job ID');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -178,13 +178,13 @@ class ShipmentsController extends AppController {
|
|||
|
||||
|
||||
function ajax_add() {
|
||||
//$this->layout = 'ajax';
|
||||
$this->layout = 'ajax';
|
||||
if(!empty($this->data)) {
|
||||
$this->Shipment->create($this->data);
|
||||
|
||||
if ($this->Shipment->saveAll($this->data)) {
|
||||
echo "SUCCESS";
|
||||
print_r($this->data);
|
||||
|
||||
}
|
||||
else {
|
||||
echo "FAILURE";
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ class Document extends AppModel {
|
|||
|
||||
'LineItem' => array(
|
||||
'className' => 'LineItem',
|
||||
'foreignKey' => 'document_id'
|
||||
'foreignKey' => 'document_id',
|
||||
'order' => 'LineItem.item_number ASC'
|
||||
),
|
||||
|
||||
'DocPage' => array(
|
||||
|
|
|
|||
|
|
@ -1,41 +1,46 @@
|
|||
<?php
|
||||
class LineItem extends AppModel {
|
||||
|
||||
var $name = 'LineItem';
|
||||
var $name = 'LineItem';
|
||||
|
||||
/**
|
||||
* @var QuoteProduct;
|
||||
*
|
||||
*/
|
||||
|
||||
var $LineItem;
|
||||
/**
|
||||
* @var QuoteProduct;
|
||||
*
|
||||
*/
|
||||
|
||||
var $LineItem;
|
||||
|
||||
|
||||
var $order = "LineItem.item_number ASC";
|
||||
|
||||
|
||||
|
||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
|
||||
|
||||
|
||||
var $belongsTo = array(
|
||||
'Product' => array('className' => 'Product',
|
||||
'foreignKey' => 'product_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
|
||||
'Document' => array('className'=> 'Document',
|
||||
'foreignKey' => 'document_id',
|
||||
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
var $hasOne = array(
|
||||
'Costing' => array('className' => 'Costing',
|
||||
'foreignKey' => 'line_item_id')
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
|
||||
|
||||
|
||||
var $belongsTo = array(
|
||||
'Product' => array('className' => 'Product',
|
||||
'foreignKey' => 'product_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
var $hasOne = array(
|
||||
'Costing' => array('className' => 'Costing',
|
||||
'foreignKey' => 'line_item_id')
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
var $order = "LineItem.item_number ASC";
|
||||
|
||||
}
|
||||
?>
|
||||
0
views/documents/ajax_edit.ctp
Normal file
0
views/documents/ajax_edit.ctp
Normal file
1
views/documents/get_product_details.ctp
Normal file
1
views/documents/get_product_details.ctp
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$javascript->object($product['Product']);?>
|
||||
1
views/documents/get_products.ctp
Normal file
1
views/documents/get_products.ctp
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$form->input('product', array('label'=>'Product', 'id'=>'productSelect', 'empty'=>'Choose Products', 'options'=>$products));?>
|
||||
|
|
@ -8,27 +8,33 @@ echo $javascript->link('document_add_edit');
|
|||
switch($docType) {
|
||||
case 'quote':
|
||||
echo $this->element('document_quote_view');
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'invoice':
|
||||
echo "INVOICE!!";
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'purchaseOrder':
|
||||
echo 'Purchase OOOOORDER!!';
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="lineItems">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="pageContentFactory">
|
||||
<?
|
||||
echo $form->input("DocPage.content", array('class'=>'page', 'label'=>'Page', 'between'=>'<button class="removePage">X</button>'));
|
||||
echo $form->input("DocPage.content", array('class'=>'page', 'label'=>'Page', 'between'=>'<button class="removePage">X</button>'));
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="lineItemModal">
|
||||
<? echo $form->input('Product.principle_id', array('id'=>'principleSelect', 'label'=>'Principle','empty'=>'Select Principle'));?>
|
||||
|
||||
</div>
|
||||
<div id="lineItemModal" title="Add Line Item">
|
||||
</div>
|
||||
|
||||
<span id="documentID"><?=$document['Document']['id']?></span>
|
||||
19
views/elements/add_edit_line_item.ctp
Normal file
19
views/elements/add_edit_line_item.ctp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<? echo $form->input('Product.principle_id', array('id'=>'principleSelect', 'label'=>'Principle','empty'=>'Select Principle'));?>
|
||||
<div id="productsDiv"></div>
|
||||
<div id="productDetails"></div>
|
||||
|
||||
<div id="lineItemDetails">
|
||||
<?
|
||||
echo $form->create('LineItem', array('default'=>false));
|
||||
echo $form->input('LineItem.document_id', array('type'=>'hidden', 'value'=>$document['Document']['id']));
|
||||
echo $form->input('LineItem.item_number');
|
||||
echo $form->input('LineItem.option');
|
||||
echo $form->input('LineItem.quantity');
|
||||
echo $form->input('LineItem.title');
|
||||
echo $form->input('LineItem.description');
|
||||
echo $form->input('LineItem.product_id', array('type'=>'hidden'));
|
||||
echo $form->end();
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ if($document['Quote']['revision'] > 0) {
|
|||
</h2>
|
||||
<?
|
||||
|
||||
echo $form->create('Document',array('type'=>'post','action'=>'edit'));
|
||||
echo $form->create('Document',array('type'=>'post','action'=>'edit', 'default'=>false));
|
||||
echo $form->input('Document.id');
|
||||
?>
|
||||
|
||||
|
|
@ -15,6 +15,9 @@ echo $form->input('Document.id');
|
|||
<button id="addLineItem">Add Line Item</button>
|
||||
</div>
|
||||
|
||||
<div id="flashMessage" class="message">
|
||||
</div>
|
||||
|
||||
<div class="pages">
|
||||
<?php foreach($document['DocPage'] as $key => $page):?>
|
||||
|
||||
|
|
@ -27,11 +30,11 @@ echo $form->input('Document.id');
|
|||
|
||||
<?endforeach?>
|
||||
</div>
|
||||
|
||||
<?=$form->end('Save');?>
|
||||
<div class="input submit"><button id="savePages">Save Pages</button></div>
|
||||
<?=$form->end();?>
|
||||
|
||||
|
||||
<? //debug($this->data);?>
|
||||
<? //debug($enquiry);?>
|
||||
<?php debug($document);?>
|
||||
<?php //debug($document);?>
|
||||
<?php //debug($docType);?>
|
||||
|
|
|
|||
25
views/line_items/add.ctp
Executable file → Normal file
25
views/line_items/add.ctp
Executable file → Normal file
|
|
@ -1,24 +1 @@
|
|||
<div class="lineItems form">
|
||||
<?php echo $form->create('LineItem');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Add LineItem');?></legend>
|
||||
<?php
|
||||
echo $form->input('item_number');
|
||||
echo $form->input('option');
|
||||
echo $form->input('product_id');
|
||||
echo $form->input('quantity');
|
||||
echo $form->input('title');
|
||||
echo $form->input('description');
|
||||
echo $form->input('document_id');
|
||||
echo $form->input('unit_price');
|
||||
echo $form->input('net_price_each');
|
||||
echo $form->input('discount_percent');
|
||||
echo $form->input('discount_amount_each');
|
||||
echo $form->input('total_discount_amount');
|
||||
echo $form->input('gross_price');
|
||||
echo $form->input('net_price');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
|
||||
<?=$this->element('add_edit_line_item');?>
|
||||
0
views/line_items/ajax_add.ctp
Normal file
0
views/line_items/ajax_add.ctp
Normal file
36
views/line_items/edit.ctp
Executable file → Normal file
36
views/line_items/edit.ctp
Executable file → Normal file
|
|
@ -1,35 +1 @@
|
|||
<div class="lineItems form">
|
||||
<?php echo $form->create('LineItem');?>
|
||||
<fieldset>
|
||||
<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('title');
|
||||
echo $form->input('description');
|
||||
echo $form->input('document_id');
|
||||
echo $form->input('product_id');
|
||||
echo $form->input('costing_id');
|
||||
echo $form->input('unit_price');
|
||||
echo $form->input('net_price_each');
|
||||
echo $form->input('discount_percent');
|
||||
echo $form->input('discount_amount_each');
|
||||
echo $form->input('total_discount_amount');
|
||||
echo $form->input('gross_price');
|
||||
echo $form->input('net_price');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<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 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>
|
||||
<?=$this->element('add_edit_line_item');?>
|
||||
50
views/line_items/get_table.ctp
Normal file
50
views/line_items/get_table.ctp
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
$('button').button();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<table class="lineItems">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ITEM<br>NO.</th>
|
||||
<th>QTY</th>
|
||||
<th>DESCRIPTION</th>
|
||||
<th>UNIT<br.PRICE</th>
|
||||
<th>TOTAL<br>PRICE</th>
|
||||
<th>ACTIONS</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><?=$currencies[$document['Quote']['currency_id']]?></th>
|
||||
<th><?=$currencies[$document['Quote']['currency_id']]?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?foreach($document['LineItem'] as $li):?>
|
||||
<tr>
|
||||
<td><?=$li['item_number'];?></td>
|
||||
<td><?=$li['quantity'];?></td>
|
||||
<td class="description"><?=$li['title'];?>
|
||||
<?=$li['description'];?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$li['unit_price'];?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$li['gross_price'];?>
|
||||
</td>
|
||||
<td>
|
||||
<button class="editLineItem">Edit</button><br>
|
||||
<button class="removeLineItem">Remove</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
<div class="lineItems index">
|
||||
<h2><?php __('LineItems');?></h2>
|
||||
<p>
|
||||
<?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)
|
||||
));
|
||||
?></p>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<th><?php echo $paginator->sort('id');?></th>
|
||||
<th><?php echo $paginator->sort('item_number');?></th>
|
||||
<th><?php echo $paginator->sort('option');?></th>
|
||||
<th><?php echo $paginator->sort('quantity');?></th>
|
||||
<th><?php echo $paginator->sort('title');?></th>
|
||||
<th><?php echo $paginator->sort('description');?></th>
|
||||
<th><?php echo $paginator->sort('document_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><?php echo $paginator->sort('net_price_each');?></th>
|
||||
<th><?php echo $paginator->sort('discount_percent');?></th>
|
||||
<th><?php echo $paginator->sort('discount_amount_each');?></th>
|
||||
<th><?php echo $paginator->sort('total_discount_amount');?></th>
|
||||
<th><?php echo $paginator->sort('gross_price');?></th>
|
||||
<th><?php echo $paginator->sort('net_price');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($lineItems as $lineItem):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['item_number']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['option']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['quantity']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['title']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['description']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['document_id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($lineItem['Product']['title'], array('controller' => 'products', 'action' => 'view', $lineItem['Product']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['costing_id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['unit_price']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['net_price_each']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['discount_percent']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['discount_amount_each']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['total_discount_amount']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['gross_price']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lineItem['LineItem']['net_price']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?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; ?>
|
||||
</table>
|
||||
</div>
|
||||
<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'));?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New LineItem', true), array('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,12 +0,0 @@
|
|||
<?php
|
||||
|
||||
echo '<option value="">Select a Product</option>';
|
||||
|
||||
if(!empty($products)) {
|
||||
|
||||
foreach($products as $k => $v) {
|
||||
echo "<option value=\"$k\">$v</option>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<?
|
||||
$i = 0;
|
||||
foreach ($options as $opt) {
|
||||
|
||||
$default_option = '';
|
||||
foreach($opt['ProductOption'] as $prodopt) {
|
||||
|
||||
|
||||
/* Make it the default selected if it's the default option
|
||||
* Logic that enforces only 1 default option to be added to the product_options controller
|
||||
*/
|
||||
|
||||
|
||||
if($prodopt['model_number'] != null) {
|
||||
$drop_options[$prodopt['id']] = $prodopt['model_number'].": ".$prodopt['title'];
|
||||
}
|
||||
else {
|
||||
$drop_options[$prodopt['id']] = $prodopt['title'];
|
||||
}
|
||||
|
||||
if($prodopt['default'] == 1) {
|
||||
$default_option = $prodopt['id'];
|
||||
$drop_options[$prodopt['id']] .= " (Default)";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* If it's an exclusive category, display a drop down box. Otherwise, check boxes
|
||||
*/
|
||||
if($opt['ProductOptionsCategory']['exclusive'] == 1) {
|
||||
echo $form->input('ProductOption.'.$opt['ProductOptionsCategory']['name'],
|
||||
array('label' => $opt['ProductOptionsCategory']['name'],
|
||||
'options' => $drop_options, 'default' => $default_option));
|
||||
}
|
||||
|
||||
else {
|
||||
echo $form->input($opt['ProductOptionsCategory']['name'],
|
||||
array('options' => $drop_options, 'default' => $default_option,
|
||||
'multiple' => 'checkbox'));
|
||||
}
|
||||
|
||||
unset($drop_options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//print_r($categories);
|
||||
|
||||
print_r($options);
|
||||
?>
|
||||
|
|
@ -1,234 +0,0 @@
|
|||
<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 $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 $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 $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 $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 $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 $lineItem['LineItem']['description']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Document Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['LineItem']['document_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($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 $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>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Net Price Each'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['LineItem']['net_price_each']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Discount Percent'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['LineItem']['discount_percent']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Discount Amount Each'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['LineItem']['discount_amount_each']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Total Discount Amount'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['LineItem']['total_discount_amount']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Gross Price'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['LineItem']['gross_price']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Net Price'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['LineItem']['net_price']; ?>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<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 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>
|
||||
<div class="related">
|
||||
<h3><?php __('Related Costings');?></h3>
|
||||
<?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 $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 $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 $lineItem['Costing']['product_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Line Item Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['line_item_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Purchase Currency Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['purchase_currency_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Sale Currency Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?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 $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 $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 $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 $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 $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 $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 $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 $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 $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 $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 $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 $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 $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 $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>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Archived');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $lineItem['Costing']['archived'];?>
|
||||
</dd>
|
||||
</dl>
|
||||
<?php endif; ?>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit Costing', true), array('controller' => 'costings', 'action' => 'edit', $lineItem['Costing']['id'])); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
<?php echo $javascript->link('editLineItem'); ?>
|
||||
|
||||
<h3><?php __($quote['Quote']['line_item_count'].' Items in this Quote');?></h3>
|
||||
<table cellpadding = "0" cellspacing = "0" id= "quoteTable" class="quoteproducts" ">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php __('Item Number'); ?></th>
|
||||
<th><?php __('Quantity'); ?></th>
|
||||
<th><?php __('Title'); ?></th>
|
||||
<th><?php __('Description'); ?></th>
|
||||
<th>Unit Price (<?php echo $quote['Currency']['iso4217']; ?>)</th>
|
||||
|
||||
<th><?php __('Total Price'); ?> (<?php echo $quote['Currency']['iso4217']; ?>)</th>
|
||||
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?
|
||||
$dontTotal = 0; //if we encounter an optional item. Make Subtotal, GST and total payable to be $TBA
|
||||
|
||||
$subTotal = 0;
|
||||
|
||||
foreach ($lineItems as $lineItem) {
|
||||
$thisNetPrice = $lineItem['LineItem']['net_price'];
|
||||
|
||||
$subTotal += $thisNetPrice;
|
||||
|
||||
if($lineItem['LineItem']['option'] == 1) {
|
||||
$dontTotal = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tfoot>
|
||||
<tr class="divider">
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="rightAlign">SUB-TOTAL (Excluding GST)</td>
|
||||
<td></td>
|
||||
<td><?php
|
||||
if($dontTotal == 0) {
|
||||
echo $quote['Currency']['symbol'].$subTotal;
|
||||
}
|
||||
else {
|
||||
echo "TBA";
|
||||
}
|
||||
|
||||
?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="rightAlign">GST (10%)</td>
|
||||
<td></td>
|
||||
<td><?php
|
||||
|
||||
if($dontTotal == 0) {
|
||||
|
||||
if($quote['Enquiry']['gst'] == 1 ) {
|
||||
$gst = 0.1 * $subTotal;
|
||||
echo $quote['Currency']['symbol'].$gst;
|
||||
|
||||
}
|
||||
else {
|
||||
$gst = 0;
|
||||
echo "N/A";
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "TBA";
|
||||
}
|
||||
|
||||
|
||||
?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="rightAlign">TOTAL PAYABLE</td>
|
||||
<td></td>
|
||||
<td><?php
|
||||
if($dontTotal == 0) {
|
||||
|
||||
$total = $subTotal + $gst;
|
||||
echo $quote['Currency']['symbol'].$total;
|
||||
|
||||
}
|
||||
else {
|
||||
echo "TBA";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tfoot>
|
||||
|
||||
<?php
|
||||
$i = 0;
|
||||
|
||||
$subTotal = 0;
|
||||
|
||||
foreach ($lineItems as $lineItem):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
|
||||
<td><?php
|
||||
if($lineItem['LineItem']['option'] == 1 ) {
|
||||
echo 'Option <br>';
|
||||
}
|
||||
echo number_format($lineItem['LineItem']['item_number'], 1, '.', '');?></td>
|
||||
|
||||
<td><?php echo $lineItem['LineItem']['quantity'];?></td>
|
||||
<td><?php echo $lineItem['LineItem']['title'];?></td>
|
||||
<td class="leftAlign"><?php echo $lineItem['LineItem']['description'];?></td>
|
||||
|
||||
<td><?php echo $quote['Currency']['symbol'].$lineItem['LineItem']['unit_price'];
|
||||
|
||||
//If there's a costing, or a discount. Show it.
|
||||
|
||||
|
||||
if($lineItem['LineItem']['discount_percent']) {
|
||||
echo "<br>less ".$lineItem['LineItem']['discount_percent']."% discount (-".
|
||||
$quote['Currency']['symbol'].$lineItem['LineItem']['discount_amount_each'].")<br>";
|
||||
echo "=<br>".$quote['Currency']['symbol'].$lineItem['LineItem']['net_price_each'];
|
||||
}
|
||||
|
||||
?></td>
|
||||
<td class="netPrice"><?php
|
||||
|
||||
|
||||
echo $quote['Currency']['symbol'].$lineItem['LineItem']['net_price']; ?></td>
|
||||
|
||||
<td class="actions">
|
||||
|
||||
<?php echo $html->link(__('View/Edit', true), array('controller'=> 'line_items', 'action'=>'edit', $lineItem['LineItem']['id']), array('class'=>'editLink')); ?>
|
||||
|
||||
|
||||
<?php echo $html->link(__('Remove', true), array('controller'=> 'line_items', 'action'=>'delete', $lineItem['LineItem']['id']), null, sprintf(__('Are you sure you want to remove # %s?', true), $lineItem['LineItem']['item_number'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</table>
|
||||
|
|
@ -1,43 +1,32 @@
|
|||
<?
|
||||
echo $javascript->link('ckeditor/ckeditor');
|
||||
echo $javascript->link('ckeditor/adapters/jquery');
|
||||
echo $javascript->link('edit_product');
|
||||
?>
|
||||
|
||||
<div class="products form">
|
||||
<?php echo $form->create('Product');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Edit Product');?></legend>
|
||||
<?php echo $form->create('Product');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Edit Product');?></legend>
|
||||
<?php
|
||||
echo $form->input('id');
|
||||
echo $form->input('principle_id');
|
||||
echo $form->input('title');
|
||||
//echo $form->input('description');
|
||||
|
||||
echo $form->input('id');
|
||||
echo $form->input('principle_id');
|
||||
echo $form->input('title');
|
||||
|
||||
/*echo "<div class=\"input text\">";
|
||||
echo "<label for=\"data[Product][description\">Description</label>";
|
||||
echo $fck->fckeditor(array('Product', 'description'), $description);
|
||||
echo "</div>";
|
||||
*/
|
||||
echo $form->input('description', array('class'=>'ckeditor'));
|
||||
echo $form->input('description');
|
||||
|
||||
|
||||
echo $form->input('model_number');
|
||||
echo $form->input('model_number_format');
|
||||
echo $form->input('cost_price_each');
|
||||
echo $form->input('our_discount');
|
||||
echo $form->input('packing_each');
|
||||
echo $form->input('shipping_weight_each');
|
||||
echo $form->input('shipping_cost_each');
|
||||
echo $form->input('duty');
|
||||
echo $form->input('sellprice_each');
|
||||
echo $form->input('notes');
|
||||
echo $form->input('model_number');
|
||||
echo $form->input('model_number_format');
|
||||
echo $form->input('cost_price_each');
|
||||
echo $form->input('our_discount');
|
||||
echo $form->input('packing_each');
|
||||
echo $form->input('shipping_weight_each');
|
||||
echo $form->input('shipping_cost_each');
|
||||
echo $form->input('duty');
|
||||
echo $form->input('sellprice_each');
|
||||
echo $form->input('notes');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end(array('label' => 'Edit Product', 'class'=>'wymupdate'));?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Delete', true), array('action'=>'delete', $form->value('Product.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('Product.id'))); ?></li>
|
||||
<li><?php echo $html->link(__('List Products', true), array('action'=>'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Principles', true), array('controller'=> 'principles', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Principle', true), array('controller'=> 'principles', 'action'=>'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Product Options', true), array('controller'=> 'product_options', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Product Option', true), array('controller'=> 'product_options', 'action'=>'add')); ?> </li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php echo $form->end(array('label' => 'Edit Product', 'class'=>'wymupdate'));?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ ul.principle-emails {
|
|||
/* background: #E9E9E9 url(../img/top-gradient2.png) repeat-x bottom; */
|
||||
/* background: #4686c3 url(../img/gradient-blue4.png) repeat-x bottom; */
|
||||
background: #4686c3;
|
||||
height: 30px;
|
||||
|
||||
/* background: #6BBA70; */
|
||||
padding-bottom: 2%;
|
||||
}
|
||||
|
|
@ -1504,4 +1506,31 @@ div.address span {
|
|||
.pages label {
|
||||
display: inline;
|
||||
padding-right: 0.2em;
|
||||
}
|
||||
|
||||
#productDetails {
|
||||
margin-top: 0.4em;
|
||||
border: 1px solid;
|
||||
}
|
||||
|
||||
table.lineItems {
|
||||
border: 1px solid;
|
||||
border-spacing: 0px;
|
||||
}
|
||||
|
||||
table.lineItems tr td {
|
||||
border: 1px solid;
|
||||
border-spacing: 0px;
|
||||
}
|
||||
|
||||
table.lineItems tr th {
|
||||
border: 1px solid;
|
||||
border-spacing: 0px;
|
||||
background-color: #f2f2f2;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
table.lineItems tr td.description {
|
||||
text-align: left;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
|
@ -3,7 +3,13 @@
|
|||
|
||||
$(function() {
|
||||
|
||||
// var config defined in global.js
|
||||
loadLineItems();
|
||||
|
||||
|
||||
$("#flashMessage").hide();
|
||||
|
||||
$("#lineItemDetails").hide();
|
||||
|
||||
$( "#lineItemModal" ).dialog({
|
||||
autoOpen: false,
|
||||
|
|
@ -12,49 +18,41 @@ $(function() {
|
|||
modal: true,
|
||||
buttons: {
|
||||
"Add Line Item": function() {
|
||||
//var thisShipmentInputs = $('#ShipmentAddForm').find('input,select,textarea');
|
||||
/*for ( instance in CKEDITOR.instances ) {
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
CKEDITOR.instances[instance].destroy();
|
||||
}*/
|
||||
$('#LineItemDescription').ckeditor(function() {
|
||||
this.updateElement();
|
||||
this.destroy();
|
||||
});
|
||||
|
||||
$.post('/line_items/ajax_add', null, function(data) {
|
||||
|
||||
var thisLineItemInputs = $('#LineItemAddForm').find('input,select,textarea');
|
||||
|
||||
$.post('/line_items/ajax_add', thisLineItemInputs, function(data) {
|
||||
$( "#lineItemModal" ).dialog('close');
|
||||
//window.location.reload(); //Change this to fetch a new copy of the table and update a <div>.
|
||||
loadLineItems();
|
||||
});
|
||||
|
||||
},
|
||||
Cancel: function() {
|
||||
$( this ).dialog( "close" );
|
||||
//$("#ShipmentAddForm")[0].reset();
|
||||
$("#principlesList").empty();
|
||||
loadLineItems();
|
||||
}
|
||||
},
|
||||
close: function() {
|
||||
|
||||
$("#importFields").hide();
|
||||
$("#principle").hide();
|
||||
|
||||
loadLineItems();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//Setup CKEditor toolbars
|
||||
var config = {
|
||||
toolbar:[
|
||||
|
||||
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Scayt'],
|
||||
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
|
||||
['Image','Table','HorizontalRule','SpecialChar'],
|
||||
'/',
|
||||
['Styles','Format'],
|
||||
['Bold','Italic','Strike'],
|
||||
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
|
||||
['Link','Unlink'],
|
||||
['Maximize','-','About']
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
|
||||
$("#pageContentFactory").hide();
|
||||
|
||||
|
||||
|
||||
//Add a new Page Element.
|
||||
$("#addPage").button().click(function(event) {
|
||||
event.preventDefault();
|
||||
|
|
@ -96,25 +94,57 @@ $(function() {
|
|||
return false;
|
||||
});
|
||||
|
||||
|
||||
//Open the LineItem dialog
|
||||
$("#addLineItem").button().click(function() {
|
||||
|
||||
$( "#lineItemModal" ).dialog('open');
|
||||
var docID = $('#documentID').html();
|
||||
|
||||
$.get('/line_items/add/'+docID, function(data) {
|
||||
$("#lineItemModal").html(data);
|
||||
$("#productDetails").hide();
|
||||
$('#LineItemDescription').ckeditor(config);
|
||||
$( "#lineItemModal" ).dialog('open');
|
||||
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#principleSelect").change(function() {
|
||||
alert("OH YEAH LETS DO THIS");
|
||||
|
||||
|
||||
$("#principleSelect").live('change',function() {
|
||||
|
||||
var principleID = getSelectedID('#principleSelect');
|
||||
|
||||
$("#productDetails").hide();
|
||||
|
||||
$.get('/documents/getProducts/'+principleID, function(data) {
|
||||
$('#productsDiv').html(data);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#productSelect").live('change',function() {
|
||||
|
||||
var productID = getSelectedID('#productSelect');
|
||||
|
||||
$.get('/documents/getProductDetails/'+productID, function(data) {
|
||||
|
||||
$("#lineItemDetails").show();
|
||||
$("#LineItemProductId").val(data.id);
|
||||
$("#LineItemTitle").val(data.title);
|
||||
$("#LineItemDescription").val(data.description);
|
||||
|
||||
|
||||
}, "json");
|
||||
});
|
||||
|
||||
|
||||
// Initialize the editor.
|
||||
// Callback function can be passed and executed after full instance creation.
|
||||
$('.page').ckeditor(config);
|
||||
|
||||
|
||||
|
||||
//Remove this Page
|
||||
|
|
@ -130,4 +160,38 @@ $(function() {
|
|||
|
||||
});
|
||||
|
||||
|
||||
$("#savePages").click(function() {
|
||||
var docPages = $('#DocumentEditForm').find('input,select,textarea');
|
||||
|
||||
$('.page').ckeditor(function() {
|
||||
this.updateElement();
|
||||
});
|
||||
|
||||
$.post('/documents/ajax_edit', docPages, function(data) {
|
||||
if(data =='SUCCESS') {
|
||||
$("#flashMessage").html("Pages Saved Successfully");
|
||||
}
|
||||
else {
|
||||
$("#flashMessage").html("Unable to Save Pages");
|
||||
}
|
||||
|
||||
$("#flashMessage").show();
|
||||
|
||||
loadLineItems();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
function loadLineItems() {
|
||||
var documentID = $("#documentID").html();
|
||||
|
||||
$.get('/line_items/getTable/'+documentID, function(data) {
|
||||
$("#lineItems").html(data);
|
||||
});
|
||||
|
||||
}
|
||||
3
webroot/js/edit_product.js
Normal file
3
webroot/js/edit_product.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$(function() {
|
||||
$('#ProductDescription').ckeditor(config);
|
||||
});
|
||||
|
|
@ -48,4 +48,20 @@ function getSelectedText(elementID) {
|
|||
text = $(selected).text();
|
||||
});
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
//Setup CKEditor toolbars
|
||||
var config = {
|
||||
toolbar:[
|
||||
|
||||
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Scayt'],
|
||||
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
|
||||
['Image','Table','HorizontalRule','SpecialChar'],
|
||||
'/',
|
||||
['Styles','Format'],
|
||||
['Bold','Italic','Strike'],
|
||||
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
|
||||
['Link','Unlink'],
|
||||
['Maximize','-','About']
|
||||
]
|
||||
};
|
||||
Loading…
Reference in a new issue