working towards quote building
This commit is contained in:
parent
7e1902089c
commit
265ff9354b
38
controllers/costings_controller.php
Normal file
38
controllers/costings_controller.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class CostingsController extends AppController {
|
||||||
|
|
||||||
|
var $name = 'Costings';
|
||||||
|
var $helpers = array('Html', 'Form','Ajax');
|
||||||
|
var $components = array('RequestHandler');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function index() {
|
||||||
|
$this->Costings->recursive = 0;
|
||||||
|
$this->set('costings', $this->paginate());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a costing to a product. It's either being added to a product, quote_product etc.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @param string $target
|
||||||
|
*/
|
||||||
|
function add($id, $target) {
|
||||||
|
|
||||||
|
if (!$id && empty($this->data)) {
|
||||||
|
$this->Session->setFlash(__('Invalid Quote ID', true));
|
||||||
|
$this->redirect(array('action'=>'index'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
@ -36,10 +36,12 @@ class QuoteProduct extends AppModel {
|
||||||
|
|
||||||
var $hasOne = array(
|
var $hasOne = array(
|
||||||
'Costing' => array('className' => 'Costing',
|
'Costing' => array('className' => 'Costing',
|
||||||
'foreignKey' => 'id')
|
'foreignKey' => 'quote_product_id')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var $order = "item_number ASC";
|
var $order = "item_number ASC";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
echo $form->input('quantity', array('class' => 'required validate-number', 'title'=>'Please enter the quantity. It must be a number'));
|
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 $form->input('principle_id', array('empty' => 'Select a Principle'));
|
||||||
echo $ajax->observeField('QuoteProductPrincipleId', array(
|
echo $ajax->observeField('QuoteProductPrincipleId', array(
|
||||||
'url' => 'principle_products',
|
'url' => 'principle_products',
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ else {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="related">
|
<div class="related">
|
||||||
<h3>Cover Page <?php echo $i; ?> </h3>
|
<h3>Page <?php echo $i; ?> </h3>
|
||||||
<div class="quotepageview">
|
<div class="quotepageview">
|
||||||
<?php echo $quotePage['content']; ?>
|
<?php echo $quotePage['content']; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -33,7 +33,7 @@ else {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php echo $html->link(__('Delete', true), array('controller'=> 'quote_pages', 'action'=>'delete', $quotePage['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quotePage['id'])); ?>
|
<?php echo $html->link(__('Delete', true), array('controller'=> 'quote_pages', 'action'=>'delete', $quotePage['id']), null, sprintf(__('Are you ABSOLUTELY sure you want to delete Page # %s? This cannot be undone.', true), $i)); ?>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -57,7 +57,6 @@ else {
|
||||||
<table cellpadding = "0" cellspacing = "0">
|
<table cellpadding = "0" cellspacing = "0">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php __('Item Number'); ?></th>
|
<th><?php __('Item Number'); ?></th>
|
||||||
<th><?php __('Option'); ?></th>
|
|
||||||
<th><?php __('Quantity'); ?></th>
|
<th><?php __('Quantity'); ?></th>
|
||||||
<th><?php __('Title'); ?></th>
|
<th><?php __('Title'); ?></th>
|
||||||
<th><?php __('Description'); ?></th>
|
<th><?php __('Description'); ?></th>
|
||||||
|
|
@ -75,8 +74,12 @@ else {
|
||||||
?>
|
?>
|
||||||
<tr<?php echo $class;?>>
|
<tr<?php echo $class;?>>
|
||||||
|
|
||||||
<td><?php echo number_format($quoteProduct['QuoteProduct']['item_number'], 1, '.', '');?></td>
|
<td><?php
|
||||||
<td><?php echo $quoteProduct['QuoteProduct']['option'];?></td>
|
if($quoteProduct['QuoteProduct']['option'] == 1 ) {
|
||||||
|
echo 'Option <br>';
|
||||||
|
}
|
||||||
|
echo number_format($quoteProduct['QuoteProduct']['item_number'], 1, '.', '');?></td>
|
||||||
|
|
||||||
|
|
||||||
<td><?php echo $quoteProduct['QuoteProduct']['quantity'];?></td>
|
<td><?php echo $quoteProduct['QuoteProduct']['quantity'];?></td>
|
||||||
<td><?php echo $quoteProduct['QuoteProduct']['title'];?></td>
|
<td><?php echo $quoteProduct['QuoteProduct']['title'];?></td>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue