Completed most of the change to line_items. Javascript buildup in-progress
This commit is contained in:
parent
942ff4bfb0
commit
f7407e0e3e
|
|
@ -2,7 +2,7 @@
|
|||
class CostingsController extends AppController {
|
||||
|
||||
var $name = 'Costings';
|
||||
var $helpers = array('Html', 'Form');
|
||||
var $helpers = array('Html', 'Form', 'Javascript');
|
||||
|
||||
function index() {
|
||||
$this->Costing->recursive = 0;
|
||||
|
|
@ -28,10 +28,10 @@ class CostingsController extends AppController {
|
|||
}
|
||||
}
|
||||
$products = $this->Costing->Product->find('list');
|
||||
$quoteProducts = $this->Costing->QuoteProduct->find('list');
|
||||
$lineItems = $this->Costing->LineItem->find('list');
|
||||
$purchaseCurrencies = $this->Costing->PurchaseCurrency->find('list');
|
||||
$saleCurrencies = $this->Costing->SaleCurrency->find('list');
|
||||
$this->set(compact('products', 'quoteProducts', 'purchaseCurrencies', 'saleCurrencies'));
|
||||
$this->set(compact('products', 'lineItems', 'purchaseCurrencies', 'saleCurrencies'));
|
||||
}
|
||||
|
||||
function edit($id = null) {
|
||||
|
|
@ -51,10 +51,10 @@ class CostingsController extends AppController {
|
|||
$this->data = $this->Costing->read(null, $id);
|
||||
}
|
||||
$products = $this->Costing->Product->find('list');
|
||||
$quoteProducts = $this->Costing->QuoteProduct->find('list');
|
||||
$lineItems = $this->Costing->LineItem->find('list');
|
||||
$purchaseCurrencies = $this->Costing->PurchaseCurrency->find('list');
|
||||
$saleCurrencies = $this->Costing->SaleCurrency->find('list');
|
||||
$this->set(compact('products','quoteProducts','purchaseCurrencies','saleCurrencies'));
|
||||
$this->set(compact('products','lineItems','purchaseCurrencies','saleCurrencies'));
|
||||
}
|
||||
|
||||
function delete($id = null) {
|
||||
|
|
|
|||
134
controllers/line_items_controller.php
Normal file
134
controllers/line_items_controller.php
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
<?php
|
||||
class LineItemsController extends AppController {
|
||||
|
||||
var $name = 'LineItems';
|
||||
var $helpers = array('Html', 'Form');
|
||||
|
||||
function index() {
|
||||
$this->LineItem->recursive = 0;
|
||||
$this->set('quoteProducts', $this->paginate());
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid LineItem.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$this->set('quoteProduct', $this->LineItem->read(null, $id));
|
||||
}
|
||||
|
||||
function add($quoteid = null) {
|
||||
|
||||
if (!$quoteid && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid Quote ID', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$this->LineItem->create();
|
||||
|
||||
$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'];
|
||||
|
||||
|
||||
$numberOfItems = $this->LineItem->find('count',
|
||||
array('conditions' => array('LineItem.quote_id' => $this->data['LineItem']['quote_id'])));
|
||||
|
||||
$numberOfItems++;
|
||||
|
||||
$this->data['LineItem']['item_number'] = $numberOfItems;
|
||||
|
||||
|
||||
|
||||
if ($this->LineItem->save($this->data)) {
|
||||
$quoteid = $this->data['LineItem']['quote_id'];
|
||||
|
||||
$this->Session->setFlash(__('Product Added to Quote Successfully', true));
|
||||
$this->redirect(array('controller'=>'quotes', 'action'=>'view', $quoteid));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The LineItem could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$principles = $this->LineItem->Product->Principle->find('list');
|
||||
|
||||
$quote = $this->LineItem->Quote->read(null, $quoteid);
|
||||
$this->set(compact('principles','quote', 'products'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* 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']));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -106,51 +106,51 @@ class QuotePagesController extends AppController {
|
|||
}
|
||||
else {
|
||||
$quotePage = $this->QuotePage->read(null, $id);
|
||||
|
||||
|
||||
//$enquiry = $this->QuotePage->Quote->Enquiry->find('all', array('conditions' => array('Enquiry.id' => $quotePage['Quote']['enquiry_id'])));
|
||||
|
||||
$enquiry = $this->QuotePage->Quote->Enquiry->read(null, $quotePage['Quote']['enquiry_id']);
|
||||
|
||||
// $quote = $this->QuotePage->Quote->find('all', array('conditions' => array('Quote.id' => $quotePage['Quote']['id'])));
|
||||
// $quote = $this->QuotePage->Quote->find('all', array('conditions' => array('Quote.id' => $quotePage['Quote']['id'])));
|
||||
|
||||
$quoteProducts = $this->QuotePage->Quote->QuoteProduct->find('all', array('recursive' => 0, 'conditions' =>
|
||||
array('QuoteProduct.quote_id' => $quotePage['Quote']['id']),
|
||||
'order' => array('QuoteProduct.item_number ASC'))
|
||||
);
|
||||
$quoteProducts = $this->QuotePage->Quote->LineItem->find('all', array('recursive' => 0, 'conditions' =>
|
||||
array('LineItem.quote_id' => $quotePage['Quote']['id']),
|
||||
'order' => array('LineItem.item_number ASC'))
|
||||
);
|
||||
|
||||
$contactFirstName = $enquiry['Contact']['first_name'];
|
||||
$contactFirstName = $enquiry['Contact']['first_name'];
|
||||
|
||||
$salesEngineerName = $enquiry['User']['first_name'].' '.$enquiry['User']['last_name'];
|
||||
$salesEngineerName = $enquiry['User']['first_name'].' '.$enquiry['User']['last_name'];
|
||||
|
||||
$productRows = "";
|
||||
$productRows = "";
|
||||
|
||||
|
||||
foreach($quoteProducts as $quoteproduct) {
|
||||
foreach($quoteProducts as $quoteproduct) {
|
||||
|
||||
$itemNumber = $quoteproduct['QuoteProduct']['item_number'];
|
||||
$title = $quoteproduct['QuoteProduct']['title'];
|
||||
|
||||
if($quoteproduct['QuoteProduct']['option'] == 1) {
|
||||
$optionText = "Option ";
|
||||
}
|
||||
else {
|
||||
$optionText = "";
|
||||
}
|
||||
$itemNumber = $quoteproduct['LineItem']['item_number'];
|
||||
$title = $quoteproduct['LineItem']['title'];
|
||||
|
||||
$productRows .= <<<ENDROW
|
||||
if($quoteproduct['LineItem']['option'] == 1) {
|
||||
$optionText = "Option ";
|
||||
}
|
||||
else {
|
||||
$optionText = "";
|
||||
}
|
||||
|
||||
$productRows .= <<<ENDROW
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
$optionText
|
||||
$itemNumber
|
||||
$optionText
|
||||
$itemNumber
|
||||
</td>
|
||||
<td>
|
||||
$title
|
||||
$title
|
||||
</td>
|
||||
</tr>
|
||||
ENDROW;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->data['QuotePage']['content'] = <<<ENDCONTENT
|
||||
|
|
@ -169,7 +169,7 @@ ENDROW;
|
|||
</tr>
|
||||
|
||||
|
||||
$productRows
|
||||
$productRows
|
||||
|
||||
</tbody>
|
||||
</table
|
||||
|
|
@ -181,18 +181,18 @@ $productRows
|
|||
<p>$salesEngineerName</p>
|
||||
|
||||
ENDCONTENT;
|
||||
|
||||
|
||||
|
||||
if (!empty($this->data)) {
|
||||
if ($this->QuotePage->save($this->data)) {
|
||||
$this->Session->setFlash(__('The QuotePage has been saved', true));
|
||||
$id = $quotePage['Quote']['id'];
|
||||
$this->redirect(array('controller' => 'quotes', 'action'=>'view/'.$id));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The QuotePage could not be saved. Please, try again.', true));
|
||||
|
||||
if (!empty($this->data)) {
|
||||
if ($this->QuotePage->save($this->data)) {
|
||||
$this->Session->setFlash(__('The QuotePage has been saved', true));
|
||||
$id = $quotePage['Quote']['id'];
|
||||
$this->redirect(array('controller' => 'quotes', 'action'=>'view/'.$id));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The QuotePage could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ class QuotesController extends AppController {
|
|||
}
|
||||
|
||||
|
||||
$quoteProducts = $this->Quote->QuoteProduct->find('all', array('recursive' => 0, 'conditions' => array('QuoteProduct.quote_id' => $id),
|
||||
'order' => array('QuoteProduct.item_number ASC'))
|
||||
$quoteProducts = $this->Quote->LineItem->find('all', array('recursive' => 0, 'conditions' => array('LineItem.quote_id' => $id),
|
||||
'order' => array('LineItem.item_number ASC'))
|
||||
);
|
||||
|
||||
$this->set('customer', $this->Quote->Enquiry->Customer->read(null, $quote['Enquiry']['customer_id']));
|
||||
|
|
@ -125,8 +125,8 @@ class QuotesController extends AppController {
|
|||
$enquiry = $this->Quote->Enquiry->find('first', array('conditions' => array('Enquiry.id' => $quote['Quote']['enquiry_id'])));
|
||||
|
||||
|
||||
$quoteProducts = $this->Quote->QuoteProduct->find('all', array('recursive' => 0, 'conditions' => array('QuoteProduct.quote_id' => $id),
|
||||
'order' => array('QuoteProduct.item_number ASC'))
|
||||
$quoteProducts = $this->Quote->LineItem->find('all', array('recursive' => 0, 'conditions' => array('LineItem.quote_id' => $id),
|
||||
'order' => array('LineItem.item_number ASC'))
|
||||
);
|
||||
|
||||
$user = $this->Quote->Enquiry->User->find('first', array('conditions' => array('User.id' => $enquiry['Enquiry']['user_id'])));
|
||||
|
|
|
|||
|
|
@ -14,16 +14,11 @@ class Costing extends AppModel {
|
|||
'order' => ''
|
||||
),
|
||||
|
||||
'QuoteProduct' => array('className'=>'QuoteProduct','foreignKey' => 'quote_product_id'
|
||||
'LineItem' => array('className'=>'LineItem','foreignKey' => 'line_item_id'
|
||||
),
|
||||
'PurchaseCurrency' => array('className' => 'Currency', 'foreignKey' => 'purchase_currency_id'),
|
||||
'SaleCurrency' => array('className' => 'Currency', 'foreignKey' => 'sale_currency_id')
|
||||
|
||||
//'ProductOption' => array('className' => 'ProductOption', 'foreignKey' => 'product_option_id'),
|
||||
//'QuoteProductOption'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
|
|
|||
48
models/line_item.php
Normal file
48
models/line_item.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
class LineItem extends AppModel {
|
||||
|
||||
var $name = 'LineItem';
|
||||
|
||||
/**
|
||||
* @var QuoteProduct;
|
||||
*
|
||||
*/
|
||||
|
||||
var $LineItem;
|
||||
|
||||
|
||||
|
||||
|
||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
|
||||
|
||||
|
||||
var $belongsTo = array(
|
||||
'Quote' => array('className' => 'Quote',
|
||||
'foreignKey' => 'quote_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
'Product' => array('className' => 'Product',
|
||||
'foreignKey' => 'product_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
|
||||
var $hasOne = array(
|
||||
'Costing' => array('className' => 'Costing',
|
||||
'foreignKey' => 'line_item_id')
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
var $order = "item_number ASC";
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -24,7 +24,7 @@ class Quote extends AppModel {
|
|||
);
|
||||
|
||||
var $hasMany = array(
|
||||
'QuoteProduct' => array('className' => 'QuoteProduct',
|
||||
'LineItem' => array('className' => 'LineItem',
|
||||
'foreignKey' => 'quote_id',
|
||||
'dependent' => false,
|
||||
'conditions' => '',
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
<?php echo $javascript->link('add_costing'); ?>
|
||||
|
||||
<div class="costings form">
|
||||
|
||||
|
||||
|
||||
<?php echo $form->create('Costing');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Add Costing');?></legend>
|
||||
<?php
|
||||
echo $form->input('product_id');
|
||||
echo $form->input('quote_product_id');
|
||||
echo $form->input('order_product_id');
|
||||
echo $form->input('invoice_product_id');
|
||||
echo $form->input('line_item_id');
|
||||
echo $form->input('purchase_currency_id');
|
||||
echo $form->input('sale_currency_id');
|
||||
echo $form->input('quantity');
|
||||
|
|
@ -18,59 +15,28 @@
|
|||
echo $form->input('our_discount_percent');
|
||||
echo $form->input('packing');
|
||||
|
||||
echo '<div class="input text">';
|
||||
echo $form->label('fob_country_of_export', 'F.O.B Country of Export');
|
||||
echo $form->text('fob_country_of_export', array('readonly'=>'readonly', 'id'=>'fob_country_of_export'));
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="input text">';
|
||||
echo $form->label('convert_to_aud', 'Convert to A$');
|
||||
echo $form->text('convert_to_aud', array('readonly'=>'readonly', 'id'=>'convert_to_aud'));
|
||||
echo '</div>';
|
||||
|
||||
|
||||
echo $form->input('FobCountryOfExport');
|
||||
echo $form->input('shipping_weight');
|
||||
echo $form->input('shipping_cost');
|
||||
echo $form->input('duty_percent');
|
||||
echo $form->input('customs');
|
||||
echo $form->input('finance_percent', array('after'=>'<p id="financeamount"> </p>'));
|
||||
echo $form->input('finance_percent');
|
||||
echo $form->input('misc_costs');
|
||||
echo $form->input('gross_sell_price');
|
||||
echo $form->input('sale_discount_percent');
|
||||
echo $form->input('net_sell_price');
|
||||
|
||||
echo '<div class="input text">';
|
||||
echo $form->label('total_landed_cost', 'Total Landed Cost');
|
||||
echo $form->text('total_landed_cost', array('readonly'=>'readonly', 'id'=>'total_landed_cost'));
|
||||
echo '</div>';
|
||||
echo $form->input('sellprice_each', array('label' => 'Sell Price Each', 'id'=>'sellprice_each'));
|
||||
echo '<div class="input text">';
|
||||
echo $form->label('gross_profit_dollars', 'Gross Profit $');
|
||||
echo $form->text('gross_profit_dollars', array('readonly'=>'readonly', 'id'=>'gross_profit_dollars'));
|
||||
echo '</div>';
|
||||
echo '<div class="input text">';
|
||||
echo $form->label('gross_profit_percent', 'Gross Profit %');
|
||||
echo $form->text('gross_profit_prercent', array('readonly'=>'readonly', 'id'=>'gross_profit_percent'));
|
||||
echo '</div>';
|
||||
|
||||
|
||||
//echo $ajax->observeForm('CostingAddForm', array('frequency' => 0.5, 'complete'=>'buildup()'));
|
||||
|
||||
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
|
||||
<?php echo $javascript->link('quotenik/add_costing', true); ?>
|
||||
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('List Costings', 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 Quote Products', true), array('controller' => 'quote_products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote Product', true), array('controller' => 'quote_products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Line Items', true), array('controller' => 'line_items', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Line Item', true), array('controller' => 'line_items', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Purchase Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@
|
|||
<?php
|
||||
echo $form->input('id');
|
||||
echo $form->input('product_id');
|
||||
echo $form->input('quote_product_id');
|
||||
echo $form->input('order_product_id');
|
||||
echo $form->input('invoice_product_id');
|
||||
echo $form->input('line_item_id');
|
||||
echo $form->input('purchase_currency_id');
|
||||
echo $form->input('sale_currency_id');
|
||||
echo $form->input('quantity');
|
||||
|
|
@ -34,8 +32,8 @@
|
|||
<li><?php echo $html->link(__('List Costings', 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 Quote Products', true), array('controller' => 'quote_products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote Product', true), array('controller' => 'quote_products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Line Items', true), array('controller' => 'line_items', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Line Item', true), array('controller' => 'line_items', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Purchase Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ echo $paginator->counter(array(
|
|||
<th><?php echo $paginator->sort('id');?></th>
|
||||
<th><?php echo $paginator->sort('created');?></th>
|
||||
<th><?php echo $paginator->sort('product_id');?></th>
|
||||
<th><?php echo $paginator->sort('quote_product_id');?></th>
|
||||
<th><?php echo $paginator->sort('order_product_id');?></th>
|
||||
<th><?php echo $paginator->sort('invoice_product_id');?></th>
|
||||
<th><?php echo $paginator->sort('line_item_id');?></th>
|
||||
<th><?php echo $paginator->sort('purchase_currency_id');?></th>
|
||||
<th><?php echo $paginator->sort('sale_currency_id');?></th>
|
||||
<th><?php echo $paginator->sort('quantity');?></th>
|
||||
|
|
@ -51,13 +49,7 @@ foreach ($costings as $costing):
|
|||
<?php echo $html->link($costing['Product']['title'], array('controller' => 'products', 'action' => 'view', $costing['Product']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($costing['QuoteProduct']['title'], array('controller' => 'quote_products', 'action' => 'view', $costing['QuoteProduct']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['order_product_id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['invoice_product_id']; ?>
|
||||
<?php echo $html->link($costing['LineItem']['title'], array('controller' => 'line_items', 'action' => 'view', $costing['LineItem']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($costing['PurchaseCurrency']['name'], array('controller' => 'currencies', 'action' => 'view', $costing['PurchaseCurrency']['id'])); ?>
|
||||
|
|
@ -126,8 +118,8 @@ foreach ($costings as $costing):
|
|||
<li><?php echo $html->link(__('New Costing', 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 Quote Products', true), array('controller' => 'quote_products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote Product', true), array('controller' => 'quote_products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Line Items', true), array('controller' => 'line_items', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Line Item', true), array('controller' => 'line_items', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Purchase Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -16,19 +16,9 @@
|
|||
<?php echo $html->link($costing['Product']['title'], array('controller' => 'products', 'action' => 'view', $costing['Product']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quote Product'); ?></dt>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Line Item'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($costing['QuoteProduct']['title'], array('controller' => 'quote_products', 'action' => 'view', $costing['QuoteProduct']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Order Product Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['order_product_id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Invoice Product Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['invoice_product_id']; ?>
|
||||
<?php echo $html->link($costing['LineItem']['title'], array('controller' => 'line_items', 'action' => 'view', $costing['LineItem']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Purchase Currency'); ?></dt>
|
||||
|
|
@ -121,8 +111,8 @@
|
|||
<li><?php echo $html->link(__('New Costing', 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 Quote Products', true), array('controller' => 'quote_products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote Product', true), array('controller' => 'quote_products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Line Items', true), array('controller' => 'line_items', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Line Item', true), array('controller' => 'line_items', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Purchase Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@
|
|||
<?php
|
||||
echo $html->css('quotenik');
|
||||
|
||||
echo $scripts_for_layout;
|
||||
//echo $javascript->link('jquery');
|
||||
//echo $javascript->link('jquery-ui');
|
||||
echo $javascript->link('prototype');
|
||||
echo $javascript->link('scriptaculous');
|
||||
echo $javascript->link('ckeditor/ckeditor');
|
||||
echo $javascript->link('validation');
|
||||
|
||||
echo $scripts_for_layout;
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -87,28 +87,28 @@ foreach ($quote['QuotePage'] as $quotePage):
|
|||
<tr<?php echo $class;?>>
|
||||
|
||||
<td><?php
|
||||
if($quoteProduct['QuoteProduct']['option'] == 1 ) {
|
||||
if($quoteProduct['LineItem']['option'] == 1 ) {
|
||||
echo 'Option <br>';
|
||||
}
|
||||
echo number_format($quoteProduct['QuoteProduct']['item_number'], 1, '.', '');?></td>
|
||||
echo number_format($quoteProduct['LineItem']['item_number'], 1, '.', '');?></td>
|
||||
|
||||
<td><?php echo $quoteProduct['QuoteProduct']['quantity'];?></td>
|
||||
<td><?php echo $quoteProduct['QuoteProduct']['title'];?></td>
|
||||
<td class="leftAlign"><?php echo $quoteProduct['QuoteProduct']['description'];?></td>
|
||||
<td><?php echo $quote['Currency']['symbol'].$quoteProduct['QuoteProduct']['unit_price'];
|
||||
<td><?php echo $quoteProduct['LineItem']['quantity'];?></td>
|
||||
<td><?php echo $quoteProduct['LineItem']['title'];?></td>
|
||||
<td class="leftAlign"><?php echo $quoteProduct['LineItem']['description'];?></td>
|
||||
<td><?php echo $quote['Currency']['symbol'].$quoteProduct['LineItem']['unit_price'];
|
||||
?></td>
|
||||
<td><?php
|
||||
|
||||
$thisNetPrice = $quoteProduct['QuoteProduct']['unit_price']*$quoteProduct['QuoteProduct']['quantity'];
|
||||
$thisNetPrice = $quoteProduct['LineItem']['unit_price']*$quoteProduct['LineItem']['quantity'];
|
||||
|
||||
$subTotal += $thisNetPrice;
|
||||
|
||||
echo $quote['Currency']['symbol'].$thisNetPrice; ?></td>
|
||||
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'quote_products', 'action'=>'view', $quoteProduct['QuoteProduct']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=> 'quote_products', 'action'=>'edit', $quoteProduct['QuoteProduct']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller'=> 'quote_products', '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('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'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ foreach ($quote['QuotePage'] as $quotePage):
|
|||
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Add Product to this Quote', true), array('controller'=> 'quote_products', 'action'=>'add', $quote['Quote']['id']));?> </li>
|
||||
<li><?php echo $html->link(__('Add Product to this Quote', true), array('controller'=> 'line_items', 'action'=>'add', $quote['Quote']['id']));?> </li>
|
||||
<li><?php echo $html->link(__('Generate PDF from this Quote', true), array('controller'=>'quotes', 'action'=>'pdf', $quote['Quote']['id'])); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue