Fixed indents
This commit is contained in:
parent
38499864a9
commit
44026e53d9
|
|
@ -1,111 +1,111 @@
|
||||||
<?php
|
<?php
|
||||||
class LineItemsController extends AppController {
|
class LineItemsController extends AppController {
|
||||||
|
|
||||||
var $name = 'LineItems';
|
var $name = 'LineItems';
|
||||||
var $helpers = array('Html', 'Form', 'Javascript', 'Number', 'Decimal');
|
var $helpers = array('Html', 'Form', 'Javascript', 'Number', 'Decimal');
|
||||||
|
|
||||||
var $components = array('RequestHandler');
|
var $components = array('RequestHandler');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function ajax_add() {
|
function ajax_add() {
|
||||||
$this->layout = 'ajax';
|
$this->layout = 'ajax';
|
||||||
if(!empty($this->data)) {
|
if(!empty($this->data)) {
|
||||||
$this->LineItem->create($this->data);
|
$this->LineItem->create($this->data);
|
||||||
|
|
||||||
if ($this->LineItem->save($this->data)) {
|
if ($this->LineItem->save($this->data)) {
|
||||||
echo "SUCCESS";
|
echo "SUCCESS";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo "FAILURE";
|
echo "FAILURE";
|
||||||
|
|
||||||
|
//print_r($this->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "NO-DATA";
|
||||||
|
}
|
||||||
|
|
||||||
//print_r($this->data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo "NO-DATA";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function ajax_edit() {
|
||||||
|
$this->layout = 'ajax';
|
||||||
|
if(!empty($this->data)) {
|
||||||
|
|
||||||
function ajax_edit() {
|
if ($this->LineItem->save($this->data)) {
|
||||||
$this->layout = 'ajax';
|
echo "SUCCESS";
|
||||||
if(!empty($this->data)) {
|
}
|
||||||
|
else {
|
||||||
|
echo "FAILURE";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "NO-DATA";
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->LineItem->save($this->data)) {
|
|
||||||
echo "SUCCESS";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo "FAILURE";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo "NO-DATA";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function ajax_delete($id = null) {
|
||||||
function ajax_delete($id = null) {
|
$this->layout = 'ajax';
|
||||||
$this->layout = 'ajax';
|
if($id == null) {
|
||||||
if($id == null) {
|
echo "FAILURE";
|
||||||
echo "FAILURE";
|
}
|
||||||
|
else {
|
||||||
|
if ($this->LineItem->del($id)) {
|
||||||
|
echo "SUCCESS";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "FAILURE";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if ($this->LineItem->del($id)) {
|
/**
|
||||||
echo "SUCCESS";
|
* Get the products table with prices (for quotes, invoices etc)
|
||||||
}
|
* @param <type> $documentID
|
||||||
else {
|
*/
|
||||||
echo "FAILURE";
|
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);
|
||||||
|
|
||||||
|
$enquiry = $this->LineItem->Document->getEnquiry($document);
|
||||||
|
$this->set('enquiry', $enquiry);
|
||||||
|
$gst = $this->LineItem->Document->gstApplies($enquiry);
|
||||||
|
$this->set('gst',$gst);
|
||||||
|
|
||||||
|
$this->set('totals', $this->calculateTotals($document, $gst));
|
||||||
|
|
||||||
|
$currency = $this->LineItem->Document->getCurrency($document);
|
||||||
|
$this->set('currencyCode', $currency['Currency']['iso4217']);
|
||||||
|
$this->set('currencySymbol', $currency['Currency']['symbol']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
function edit($id = null) {
|
||||||
* Get the products table with prices (for quotes, invoices etc)
|
$this->layout = 'ajax';
|
||||||
* @param <type> $documentID
|
|
||||||
*/
|
$this->data = $this->LineItem->read(null,$id);
|
||||||
function getTable($documentID = null) {
|
$this->set('yesNo', array(0=>'No', 1=>'Yes'));
|
||||||
$this->layout = 'ajax';
|
$this->set('principles', $this->LineItem->Product->Principle->find('list'));
|
||||||
if($documentID == null) {
|
|
||||||
echo "INVALID DOCUMENT ID";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$document = $this->LineItem->Document->find('first',array('conditions'=>array('Document.id'=>$documentID)));
|
|
||||||
$this->set('document',$document);
|
|
||||||
|
|
||||||
$enquiry = $this->LineItem->Document->getEnquiry($document);
|
function add($documentID = null) {
|
||||||
$this->set('enquiry', $enquiry);
|
$this->layout = 'ajax';
|
||||||
$gst = $this->LineItem->Document->gstApplies($enquiry);
|
$document = $this->LineItem->Document->read(null, $documentID);
|
||||||
$this->set('gst',$gst);
|
$this->set('document', $document);
|
||||||
|
$this->set('yesNo', array(0=>'No', 1=>'Yes'));
|
||||||
$this->set('totals', $this->calculateTotals($document, $gst));
|
$this->set('principles', $this->LineItem->Product->Principle->find('list'));
|
||||||
|
|
||||||
$currency = $this->LineItem->Document->getCurrency($document);
|
|
||||||
$this->set('currencyCode', $currency['Currency']['iso4217']);
|
|
||||||
$this->set('currencySymbol', $currency['Currency']['symbol']);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function edit($id = null) {
|
|
||||||
$this->layout = 'ajax';
|
|
||||||
|
|
||||||
$this->data = $this->LineItem->read(null,$id);
|
|
||||||
$this->set('yesNo', array(0=>'No', 1=>'Yes'));
|
|
||||||
$this->set('principles', $this->LineItem->Product->Principle->find('list'));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function add($documentID = null) {
|
|
||||||
$this->layout = 'ajax';
|
|
||||||
$document = $this->LineItem->Document->read(null, $documentID);
|
|
||||||
$this->set('document', $document);
|
|
||||||
$this->set('yesNo', array(0=>'No', 1=>'Yes'));
|
|
||||||
$this->set('principles', $this->LineItem->Product->Principle->find('list'));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue