Misc costing work. Going to try to generate Excel costings

This commit is contained in:
Karl Cordes 2013-05-05 18:42:35 +10:00
parent b793d6dc31
commit f5a07bae4e
4 changed files with 18 additions and 15 deletions

View file

@ -27,21 +27,23 @@ class CostingsController extends AppController {
$this->Session->setFlash(__('The Costing could not be saved. Please, try again.', true)); $this->Session->setFlash(__('The Costing could not be saved. Please, try again.', true));
} }
} }
if(isset($this->params['named']['productid'])) { if(isset($this->params['named']['productid'])) {
$product = $this->Costing->Product->findById($this->params['named']['productid']); $product = $this->Costing->Product->findById($this->params['named']['productid']);
$this->set('product', $product);
}
if(isset($this->params['named']['lineitemid'])) { $this->set('type', 'product');
$line_item = $this->Costing->LineItem->findById($this->params['named']['lineitem']); $this->set('product', $product);
}
$this->set('line_item', $line_item);
if(isset($this->params['named']['line_item_id'])) {
$line_item = $this->Costing->LineItem->findById($this->params['named']['line_item_id']);
$this->set('type', 'line_item');
$this->set('line_item', $line_item);
die(print_r($line_item));
}
}
$purchaseCurrencies = $this->Costing->PurchaseCurrency->find('list'); $purchaseCurrencies = $this->Costing->PurchaseCurrency->find('list');
$saleCurrencies = $this->Costing->SaleCurrency->find('list'); $saleCurrencies = $this->Costing->SaleCurrency->find('list');
$this->set(compact('purchaseCurrencies', 'saleCurrencies')); $this->set(compact('purchaseCurrencies', 'saleCurrencies'));
@ -82,4 +84,4 @@ class CostingsController extends AppController {
} }
} }
?> ?>

View file

@ -727,6 +727,8 @@ class DocumentsController extends AppController {
} }
function costing() {
}
} }

View file

@ -10,6 +10,7 @@
elseif(isset($line_item)) { elseif(isset($line_item)) {
$form->input('line_item_id', array('type'=>'hidden', 'value'=>$line_item['LineItem']['id'])); $form->input('line_item_id', array('type'=>'hidden', 'value'=>$line_item['LineItem']['id']));
print_r($line_item);
} }
?> ?>

View file

@ -10,8 +10,6 @@ $(document).ready(function () {
$(":input").change(buildup) $(":input").change(buildup)
}); });
@ -168,4 +166,4 @@ function checkNaN(value) {
else { else {
return value; return value;
} }
} }