Added PO number generation
This commit is contained in:
parent
e39c06a4a1
commit
16e3ffb61f
|
|
@ -150,7 +150,7 @@ class JobsController extends AppController {
|
|||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
function delete($id = null) {
|
||||
if (!$id) {
|
||||
$this->flash(__('Invalid Job', true), array('action'=>'index'));
|
||||
|
|
@ -159,7 +159,7 @@ class JobsController extends AppController {
|
|||
$this->flash(__('Job deleted', true), array('action'=>'index'));
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
function __isNotEmptyDate($date) {
|
||||
|
|
|
|||
83
controllers/purchase_orders_controller.php
Normal file
83
controllers/purchase_orders_controller.php
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
class PurchaseOrdersController extends AppController {
|
||||
|
||||
var $name = 'PurchaseOrders';
|
||||
var $helpers = array('Html', 'Form', 'Javascript');
|
||||
|
||||
function index() {
|
||||
$this->PurchaseOrder->recursive = 0;
|
||||
$this->set('purchaseOrders', $this->paginate());
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid PurchaseOrder.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$this->set('purchaseOrder', $this->PurchaseOrder->read(null, $id));
|
||||
}
|
||||
|
||||
function add() {
|
||||
if (!empty($this->data)) {
|
||||
$this->PurchaseOrder->create();
|
||||
|
||||
$count = $this->PurchaseOrder->findCount();
|
||||
$count++;
|
||||
|
||||
$offset = 2060;
|
||||
|
||||
$count += $offset;
|
||||
|
||||
$newPOnumber = "CMCPO".$count;
|
||||
|
||||
$this->data['PurchaseOrder']['title'] = $newPOnumber;
|
||||
|
||||
|
||||
if ($this->PurchaseOrder->save($this->data)) {
|
||||
$this->Session->setFlash(__('The PurchaseOrder has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The PurchaseOrder could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
$jobs = $this->PurchaseOrder->Job->find('list');
|
||||
$principles = $this->PurchaseOrder->Principle->find('list');
|
||||
$documents = $this->PurchaseOrder->Document->find('list');
|
||||
$this->set(compact('jobs', 'principles', 'documents'));
|
||||
}
|
||||
|
||||
function edit($id = null) {
|
||||
if (!$id && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid PurchaseOrder', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if (!empty($this->data)) {
|
||||
if ($this->PurchaseOrder->save($this->data)) {
|
||||
$this->Session->setFlash(__('The PurchaseOrder has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The PurchaseOrder could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
if (empty($this->data)) {
|
||||
$this->data = $this->PurchaseOrder->read(null, $id);
|
||||
}
|
||||
$jobs = $this->PurchaseOrder->Job->find('list');
|
||||
$principles = $this->PurchaseOrder->Principle->find('list');
|
||||
$documents = $this->PurchaseOrder->Document->find('list');
|
||||
$this->set(compact('jobs','principles','documents'));
|
||||
}
|
||||
|
||||
/*function delete($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid id for PurchaseOrder', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if ($this->PurchaseOrder->del($id)) {
|
||||
$this->Session->setFlash(__('PurchaseOrder deleted', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -32,7 +32,13 @@ class Job extends AppModel {
|
|||
'Currency'
|
||||
);
|
||||
|
||||
|
||||
var $hasAndBelongsToMany = array(
|
||||
'PurchaseOrder' => array(
|
||||
'className' => 'PurchaseOrder',
|
||||
'joinTable' => 'jobs_purchase_orders',
|
||||
'unique' => true
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -21,7 +21,18 @@ class PurchaseOrder extends AppModel {
|
|||
)
|
||||
);
|
||||
|
||||
var $hasMany = array(
|
||||
var $hasAndBelongsToMany = array(
|
||||
'Job' => array(
|
||||
'className' => 'Job',
|
||||
'joinTable' => 'jobs_purchase_orders',
|
||||
'unique' => true
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
/*var $hasMany = array(
|
||||
'Shipment' => array(
|
||||
'className' => 'Shipment',
|
||||
'foreignKey' => 'purchase_order_id',
|
||||
|
|
@ -35,7 +46,7 @@ class PurchaseOrder extends AppModel {
|
|||
'finderQuery' => '',
|
||||
'counterQuery' => ''
|
||||
)
|
||||
);
|
||||
);*/
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -200,7 +200,7 @@ $class = ' class="altrow"';?>
|
|||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=>'jobs', 'action' => 'view', $job['Job']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=>'jobs','action' => 'edit', $job['Job']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller'=>'jobs','action' => 'delete', $job['Job']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $job['Job']['id'])); ?>
|
||||
<?php //echo $html->link(__('Delete', true), array('controller'=>'jobs','action' => 'delete', $job['Job']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $job['Job']['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
|||
|
|
@ -73,6 +73,12 @@
|
|||
</ul>
|
||||
</li>
|
||||
|
||||
<li><?php echo $html->link('POs', '/purchase_orders/index'); ?>
|
||||
<ul>
|
||||
<li><?php echo $html->link('PO Index', '/purchase_orders/index'); ?></li>
|
||||
<li class="last"><?php echo $html->link('New PO', '/purchase_orders/add'); ?></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
<li><?php echo $html->link('Invoices', '/invoices/index'); ?>
|
||||
|
|
|
|||
54
views/purchase_orders/add.ctp
Normal file
54
views/purchase_orders/add.ctp
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<div class="purchaseOrders form">
|
||||
<?php echo $javascript->link('addpurchaseorder'); ?>
|
||||
<?php echo $form->create('PurchaseOrder');?>
|
||||
<fieldset>
|
||||
<legend><?php __('New PurchaseOrder');?></legend>
|
||||
|
||||
|
||||
|
||||
<div class="input text">
|
||||
<label for="PurchaseOrderIssueDateDisplay">Issue Date</label>
|
||||
<input id="PurchaseOrderIssueDateDisplay" type="text" value="" class="datePicker">
|
||||
</div>
|
||||
|
||||
<div class="input text">
|
||||
<label for="PurchaseOrderDispatchDateDisplay">Dispatch Date</label>
|
||||
<input id="PurchaseOrderDispatchDateDisplay" type="text" value="" class="datePicker">
|
||||
</div>
|
||||
|
||||
<div class="input text">
|
||||
<label for="PurchaseOrderDateArrivedDisplay">Arrived Date</label>
|
||||
<input id="PurchaseOrderDateArrivedDisplay" type="text" value="" class="datePicker">
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
echo $form->input('issue_date', array('type'=>'hidden'));
|
||||
echo $form->input('dispatch_date', array('type'=>'hidden'));
|
||||
echo $form->input('date_arrived', array('type'=>'hidden'));
|
||||
echo $form->input('title', array('type'=>'hidden'));
|
||||
echo $form->input('principle_id');
|
||||
echo $form->input('principle_reference');
|
||||
echo $form->input('document_id', array('type'=>'hidden', 'value'=>0));
|
||||
echo $form->input('Job', array('label'=>'Jobs in this PO',
|
||||
'type'=>'select',
|
||||
'multiple'=>'checkbox',
|
||||
'options'=>$jobs,
|
||||
'selected'=>$html->value('Job.Job')));
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('List PurchaseOrders', true), array('action' => 'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Principles', true), array('controller' => 'principles', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Principle', true), array('controller' => 'principles', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Documents', true), array('controller' => 'documents', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Document', true), array('controller' => 'documents', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Jobs', true), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
52
views/purchase_orders/edit.ctp
Normal file
52
views/purchase_orders/edit.ctp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<div class="purchaseOrders form">
|
||||
<?php echo $javascript->link('addpurchaseorder'); ?>
|
||||
<?php echo $form->create('PurchaseOrder');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Edit PurchaseOrder');?></legend>
|
||||
|
||||
<div class="input text">
|
||||
<label for="PurchaseOrderIssueDateDisplay">Issue Date</label>
|
||||
<input id="PurchaseOrderIssueDateDisplay" type="text" value="" class="datePicker">
|
||||
</div>
|
||||
|
||||
<div class="input text">
|
||||
<label for="PurchaseOrderDispatchDateDisplay">Dispatch Date</label>
|
||||
<input id="PurchaseOrderDispatchDateDisplay" type="text" value="" class="datePicker">
|
||||
</div>
|
||||
|
||||
<div class="input text">
|
||||
<label for="PurchaseOrderDateArrivedDisplay">Arrived Date</label>
|
||||
<input id="PurchaseOrderDateArrivedDisplay" type="text" value="" class="datePicker">
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
echo $form->input('id');
|
||||
echo $form->input('issue_date', array('type'=>'hidden'));
|
||||
echo $form->input('dispatch_date', array('type'=>'hidden'));
|
||||
echo $form->input('date_arrived', array('type'=>'hidden'));
|
||||
echo $form->input('title', array('readonly'=>'readonly'));
|
||||
echo $form->input('principle_id');
|
||||
echo $form->input('principle_reference');
|
||||
echo $form->input('document_id', array('value'=>0, 'type'=>'hidden'));
|
||||
echo $form->input('Job', array('label'=>'Jobs in this PO',
|
||||
'type'=>'select',
|
||||
'multiple'=>'checkbox',
|
||||
'options'=>$jobs,
|
||||
'selected'=>$html->value('Job.Job')));
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('PurchaseOrder.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('PurchaseOrder.id'))); ?></li>
|
||||
<li><?php echo $html->link(__('List PurchaseOrders', true), array('action' => 'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Principles', true), array('controller' => 'principles', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Principle', true), array('controller' => 'principles', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Documents', true), array('controller' => 'documents', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Document', true), array('controller' => 'documents', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Jobs', true), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
78
views/purchase_orders/index.ctp
Normal file
78
views/purchase_orders/index.ctp
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<div class="purchaseOrders index">
|
||||
<h2><?php __('PurchaseOrders');?></h2>
|
||||
<p>
|
||||
<?php
|
||||
echo $paginator->counter(array(
|
||||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||
));
|
||||
?></p>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<th><?php echo $paginator->sort('id');?></th>
|
||||
<th><?php echo $paginator->sort('issue_date');?></th>
|
||||
<th><?php echo $paginator->sort('dispatch_date');?></th>
|
||||
<th><?php echo $paginator->sort('date_arrived');?></th>
|
||||
<th><?php echo $paginator->sort('title');?></th>
|
||||
<th><?php echo $paginator->sort('principle_id');?></th>
|
||||
<th><?php echo $paginator->sort('principle_reference');?></th>
|
||||
<th><?php echo $paginator->sort('document_id');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($purchaseOrders as $purchaseOrder):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['issue_date']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['dispatch_date']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['date_arrived']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['title']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($purchaseOrder['Principle']['name'], array('controller' => 'principles', 'action' => 'view', $purchaseOrder['Principle']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['principle_reference']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($purchaseOrder['Document']['id'], array('controller' => 'documents', 'action' => 'view', $purchaseOrder['Document']['id'])); ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('action' => 'view', $purchaseOrder['PurchaseOrder']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $purchaseOrder['PurchaseOrder']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $purchaseOrder['PurchaseOrder']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $purchaseOrder['PurchaseOrder']['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paging">
|
||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||
| <?php echo $paginator->numbers();?>
|
||||
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New PurchaseOrder', true), array('action' => 'add')); ?></li>
|
||||
<li><?php echo $html->link(__('List Principles', true), array('controller' => 'principles', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Principle', true), array('controller' => 'principles', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Documents', true), array('controller' => 'documents', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Document', true), array('controller' => 'documents', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Jobs', true), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
159
views/purchase_orders/view.ctp
Normal file
159
views/purchase_orders/view.ctp
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
<div class="purchaseOrders view">
|
||||
<h2><?php __('PurchaseOrder');?></h2>
|
||||
<dl><?php $i = 0; $class = ' class="altrow"';?>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Issue Date'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['issue_date']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Dispatch Date'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['dispatch_date']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Date Arrived'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['date_arrived']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Title'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['title']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($purchaseOrder['Principle']['name'], array('controller' => 'principles', 'action' => 'view', $purchaseOrder['Principle']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle Reference'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $purchaseOrder['PurchaseOrder']['principle_reference']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Document'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($purchaseOrder['Document']['id'], array('controller' => 'documents', 'action' => 'view', $purchaseOrder['Document']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit PurchaseOrder', true), array('action' => 'edit', $purchaseOrder['PurchaseOrder']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('Delete PurchaseOrder', true), array('action' => 'delete', $purchaseOrder['PurchaseOrder']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $purchaseOrder['PurchaseOrder']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('List PurchaseOrders', true), array('action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New PurchaseOrder', true), array('action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Principles', true), array('controller' => 'principles', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Principle', true), array('controller' => 'principles', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Documents', true), array('controller' => 'documents', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Document', true), array('controller' => 'documents', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Jobs', true), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3><?php __('Related Jobs');?></h3>
|
||||
<?php if (!empty($purchaseOrder['Job'])):?>
|
||||
<table cellpadding = "0" cellspacing = "0">
|
||||
<tr>
|
||||
<th><?php __('Id'); ?></th>
|
||||
<th><?php __('Created'); ?></th>
|
||||
<th><?php __('Title'); ?></th>
|
||||
<th><?php __('Enquiry Id'); ?></th>
|
||||
<th><?php __('Comments'); ?></th>
|
||||
<th><?php __('Date Order Received'); ?></th>
|
||||
<th><?php __('Date Order Placed On Principle'); ?></th>
|
||||
<th><?php __('Date Scheduled Ex Works'); ?></th>
|
||||
<th><?php __('Date Order Sent To Customer'); ?></th>
|
||||
<th><?php __('Customer Order Number'); ?></th>
|
||||
<th><?php __('Supplier Reference'); ?></th>
|
||||
<th><?php __('Domestic Freight Paid By'); ?></th>
|
||||
<th><?php __('Sale Category'); ?></th>
|
||||
<th><?php __('Shipment Category'); ?></th>
|
||||
<th><?php __('Company Gross Sales Aud'); ?></th>
|
||||
<th><?php __('Net Sales Aud'); ?></th>
|
||||
<th><?php __('Gross Profit Aud'); ?></th>
|
||||
<th><?php __('Ato Exchange Rate'); ?></th>
|
||||
<th><?php __('Gst'); ?></th>
|
||||
<th><?php __('Currency Id'); ?></th>
|
||||
<th><?php __('Gst Amount'); ?></th>
|
||||
<th><?php __('Gross Commisions'); ?></th>
|
||||
<th><?php __('Invoiced Amount Inc Gst'); ?></th>
|
||||
<th><?php __('Net Export Sales Aud'); ?></th>
|
||||
<th><?php __('Gross Profit Exports Aud'); ?></th>
|
||||
<th><?php __('Gp Percent'); ?></th>
|
||||
<th><?php __('Gross Australian Sales Foreign Currency'); ?></th>
|
||||
<th><?php __('Net Australian Sales Foreign Currency'); ?></th>
|
||||
<th><?php __('Gross Profit Value Australian Sales Foreign Currency'); ?></th>
|
||||
<th><?php __('Gross Export Sales Foreign Currency'); ?></th>
|
||||
<th><?php __('Net Export Sales Foreign Currency'); ?></th>
|
||||
<th><?php __('Gross Profit Value After Discount Exports Foreign Currency'); ?></th>
|
||||
<th><?php __('Gross Commissions'); ?></th>
|
||||
<th><?php __('Net Commissions'); ?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($purchaseOrder['Job'] as $job):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td><?php echo $job['id'];?></td>
|
||||
<td><?php echo $job['created'];?></td>
|
||||
<td><?php echo $job['title'];?></td>
|
||||
<td><?php echo $job['enquiry_id'];?></td>
|
||||
<td><?php echo $job['comments'];?></td>
|
||||
<td><?php echo $job['date_order_received'];?></td>
|
||||
<td><?php echo $job['date_order_placed_on_principle'];?></td>
|
||||
<td><?php echo $job['date_scheduled_ex_works'];?></td>
|
||||
<td><?php echo $job['date_order_sent_to_customer'];?></td>
|
||||
<td><?php echo $job['customer_order_number'];?></td>
|
||||
<td><?php echo $job['supplier_reference'];?></td>
|
||||
<td><?php echo $job['domestic_freight_paid_by'];?></td>
|
||||
<td><?php echo $job['sale_category'];?></td>
|
||||
<td><?php echo $job['shipment_category'];?></td>
|
||||
<td><?php echo $job['company_gross_sales_aud'];?></td>
|
||||
<td><?php echo $job['net_sales_aud'];?></td>
|
||||
<td><?php echo $job['gross_profit_aud'];?></td>
|
||||
<td><?php echo $job['ato_exchange_rate'];?></td>
|
||||
<td><?php echo $job['gst'];?></td>
|
||||
<td><?php echo $job['currency_id'];?></td>
|
||||
<td><?php echo $job['gst_amount'];?></td>
|
||||
<td><?php echo $job['gross_commisions'];?></td>
|
||||
<td><?php echo $job['invoiced_amount_inc_gst'];?></td>
|
||||
<td><?php echo $job['net_export_sales_aud'];?></td>
|
||||
<td><?php echo $job['gross_profit_exports_aud'];?></td>
|
||||
<td><?php echo $job['gp_percent'];?></td>
|
||||
<td><?php echo $job['gross_australian_sales_foreign_currency'];?></td>
|
||||
<td><?php echo $job['net_australian_sales_foreign_currency'];?></td>
|
||||
<td><?php echo $job['gross_profit_value_australian_sales_foreign_currency'];?></td>
|
||||
<td><?php echo $job['gross_export_sales_foreign_currency'];?></td>
|
||||
<td><?php echo $job['net_export_sales_foreign_currency'];?></td>
|
||||
<td><?php echo $job['gross_profit_value_after_discount_exports_foreign_currency'];?></td>
|
||||
<td><?php echo $job['gross_commissions'];?></td>
|
||||
<td><?php echo $job['net_commissions'];?></td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller' => 'jobs', 'action' => 'view', $job['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller' => 'jobs', 'action' => 'edit', $job['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller' => 'jobs', 'action' => 'delete', $job['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $job['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add'));?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
33
webroot/js/addpurchaseorder.js
Normal file
33
webroot/js/addpurchaseorder.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/**
|
||||
* file: addpurchaseorder.js
|
||||
*/
|
||||
|
||||
|
||||
$(function() {
|
||||
|
||||
$('#PurchaseOrderIssueDateDisplay').datepicker({
|
||||
showButtonPanel: true,
|
||||
dateFormat: 'DD d MM yy',
|
||||
altFormat: 'yy-mm-dd',
|
||||
altField: '#PurchaseOrderIssueDate'
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#PurchaseOrderDispatchDateDisplay').datepicker({
|
||||
showButtonPanel: true,
|
||||
dateFormat: 'DD d MM yy',
|
||||
altFormat: 'yy-mm-dd',
|
||||
altField: '#PurchaseOrderDispatchDate'
|
||||
|
||||
});
|
||||
|
||||
$('#PurchaseOrderDateArrivedDisplay').datepicker({
|
||||
showButtonPanel: true,
|
||||
dateFormat: 'DD d MM yy',
|
||||
altFormat: 'yy-mm-dd',
|
||||
altField: '#PurchaseOrderDateArrived'
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
27
webroot/js/jobindex.js
Normal file
27
webroot/js/jobindex.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* jobindex.js
|
||||
*
|
||||
* handle the modal window Edit funcionality on the job index page.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
$(function() {
|
||||
|
||||
// $('.editWindow').click(doGet($(this).attr('href')));
|
||||
$('.editWindow').click(alert($(this).attr('href')));
|
||||
//$('.editWindow').click(alert($(this).attr('href'))
|
||||
//);
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
function doGet(link) {
|
||||
alert(link);
|
||||
//
|
||||
// $.get("/jobs/edit/3", function(data){
|
||||
// alert("Data Loaded: " + data);
|
||||
// });
|
||||
return false;
|
||||
}
|
||||
16
webroot/js/jquery.validate.min.js
vendored
Normal file
16
webroot/js/jquery.validate.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue