jQuery-fying the Quote View Page
This commit is contained in:
parent
fbc78cfd27
commit
cd8165f3cd
|
|
@ -39,5 +39,10 @@ class AppController extends Controller {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
class EnquiriesController extends AppController {
|
||||
|
||||
var $name = 'Enquiries';
|
||||
var $helpers = array('Html', 'Form', 'Javascript', 'Time', 'Ajax', 'Number', 'Text', 'Cache');
|
||||
var $helpers = array('Html', 'Form', 'Javascript', 'Time', 'Number', 'Text', 'Cache');
|
||||
|
||||
var $paginate = array(
|
||||
|
||||
|
|
@ -28,6 +28,8 @@ class EnquiriesController extends AppController {
|
|||
$status_list[$statusid] = $status['Status']['name'];
|
||||
}
|
||||
$this->set('status_list', $status_list);
|
||||
|
||||
|
||||
//debug($this->paginate());
|
||||
// $this->set('status_list', $this->Enquiry->Status->find('list'));
|
||||
}
|
||||
|
|
|
|||
2
vendors/xtcpdf.php
vendored
2
vendors/xtcpdf.php
vendored
|
|
@ -308,6 +308,8 @@ class XTCPDF extends TCPDF {
|
|||
$thisTotalPrice = $product[$docType]['quantity']*$product[$docType]['unit_price'];
|
||||
$this->MultiCell($totalPricColwidth, $heightNeeded, $this->formatCurrency($currency['symbol'],$thisTotalPrice), 1, "C", 0, 1);
|
||||
|
||||
|
||||
|
||||
$subTotal += $thisTotalPrice;
|
||||
$lastY = $this->GetY();
|
||||
$lastX = $this->GetX();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php echo $javascript->link('quotenik/product_buildup.js', false); ?>
|
||||
|
||||
<div class="addproduct">
|
||||
<?php echo $form->create('Product', array('id'=>'productaddform', 'class'=>'addproduct'));?>
|
||||
<fieldset>
|
||||
|
|
@ -13,22 +13,14 @@
|
|||
|
||||
echo $form->input('notes');
|
||||
|
||||
echo $html->link('Show/Hide Costing Details', '#', array('onClick' => "Effect.toggle('costingdetails', 'appear'); return false;"));
|
||||
|
||||
echo $html->image('calculator.png');
|
||||
echo $ajax->div('costingdetails');
|
||||
|
||||
//echo $this->e
|
||||
//lement('product_costing', array('modelName' => 'Product'));
|
||||
|
||||
echo $ajax->divEnd('costingdetails');
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end(array('label' => 'Add Product'));
|
||||
echo $javascript->codeBlock("new Validation('productaddform', {immediate : true, useTitles : true});", array('allowCache'=>true, 'safe'=>false));
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
App::import('Vendor','xtcpdf');
|
||||
|
||||
|
||||
//print_r($quote);
|
||||
|
||||
//print_r($enquiry);
|
||||
|
||||
$tcpdf = new XTCPDF('P', 'mm', 'A4', true, false, 'UTF-8');
|
||||
|
||||
|
|
@ -93,7 +90,7 @@ $principle_name = strtoupper($enquiry['Principle']['name']);
|
|||
|
||||
debug($commercialDetails);
|
||||
|
||||
$tcpdf->productPage($principle_name, $quote['Currency'], $enquiry['Enquiry']['gst'], $products, 'QuoteProduct', $commercialDetails);
|
||||
$tcpdf->productPage($principle_name, $quote['Currency'], $enquiry['Enquiry']['gst'], $products, 'LineItem', $commercialDetails);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -95,8 +95,9 @@ foreach ($quote['QuotePage'] as $quotePage):
|
|||
<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>
|
||||
<td><?php
|
||||
|
||||
$thisNetPrice = $quoteProduct['LineItem']['unit_price']*$quoteProduct['LineItem']['quantity'];
|
||||
|
|
@ -182,23 +183,23 @@ foreach ($quote['QuotePage'] as $quotePage):
|
|||
|
||||
|
||||
<?php echo $form->create('Quote');?>
|
||||
<fieldset>
|
||||
<?php
|
||||
echo $form->input('id', array('type' => 'hidden', 'value' => $quote['Quote']['id']));
|
||||
<fieldset>
|
||||
<?php
|
||||
echo $form->input('id', array('type' => 'hidden', 'value' => $quote['Quote']['id']));
|
||||
|
||||
echo $form->input('enquiry_id', array('type' => 'hidden'));
|
||||
echo $form->input('delivery_time');
|
||||
echo $this->element('payment_terms_box');
|
||||
echo $form->input('date_issued');
|
||||
echo $form->input('days_valid', array('default'=>'30'));
|
||||
echo $form->input('currency_id', array('label' => 'Sale Currency', 'options' => $currencies));
|
||||
echo $form->input('delivery_point', array('default' => 'EX-CMC TECHNOLOGIES, ALEXANDRIA NSW'));
|
||||
echo $form->input('exchange_rate', array('default' => 'FIXED'));
|
||||
echo $form->input('customs_duty', array('default' => 'NIL'));
|
||||
echo $form->input('enquiry_id', array('type' => 'hidden'));
|
||||
echo $form->input('delivery_time');
|
||||
echo $this->element('payment_terms_box');
|
||||
echo $form->input('date_issued');
|
||||
echo $form->input('days_valid', array('default'=>'30'));
|
||||
echo $form->input('currency_id', array('label' => 'Sale Currency', 'options' => $currencies));
|
||||
echo $form->input('delivery_point', array('default' => 'EX-CMC TECHNOLOGIES, ALEXANDRIA NSW'));
|
||||
echo $form->input('exchange_rate', array('default' => 'FIXED'));
|
||||
echo $form->input('customs_duty', array('default' => 'NIL'));
|
||||
|
||||
echo $form->end('Update Commercial Terms');
|
||||
?>
|
||||
</fieldset>
|
||||
echo $form->end('Update Commercial Terms');
|
||||
?>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
|
|
@ -208,3 +209,39 @@ foreach ($quote['QuotePage'] as $quotePage):
|
|||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<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('quantity');
|
||||
echo $form->input('title');
|
||||
echo $form->input('description');
|
||||
echo $form->input('quote_id');
|
||||
echo $form->input('product_id');
|
||||
echo $form->input('costing_id');
|
||||
echo $form->input('unit_price');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php debug ($quoteProducts); ?>
|
||||
|
||||
<?php foreach ($quoteProducts as $quoteProduct) {
|
||||
|
||||
if($quoteProduct['Costing']) {
|
||||
echo "YAY. We have a costing for: ".$quoteProduct['LineItem']['title'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
function doModelConfig() {
|
||||
$("#sortable").sortable('enable');
|
||||
alert('fuck');
|
||||
|
||||
//$("#sortable").sortable('disable');
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue