Shipment indexes working
This commit is contained in:
parent
f88e10ae54
commit
6188e20090
|
|
@ -8,15 +8,59 @@ class ShipmentsController extends AppController {
|
|||
var $paginate = array(
|
||||
|
||||
'contain' => false,
|
||||
'limit' => 100,
|
||||
'limit' => 300,
|
||||
'order'=>array('Shipment.id' => 'desc'),
|
||||
'recursive' => 1
|
||||
|
||||
);
|
||||
|
||||
function index() {
|
||||
function index($type = 'all') {
|
||||
|
||||
|
||||
|
||||
|
||||
$this->Shipment->recursive = 0;
|
||||
$this->set('shipments', $this->paginate());
|
||||
|
||||
switch($type) {
|
||||
|
||||
case 'all':
|
||||
$conditions = array();
|
||||
break;
|
||||
|
||||
case 'import':
|
||||
|
||||
$conditions = array('Shipment.type'=>1);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'direct':
|
||||
$conditions = array('Shipment.type'=>2);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'export':
|
||||
$conditions = array('Shipment.type'=>3);
|
||||
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'local':
|
||||
$conditions = array('Shipment.type'=>4);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
|
||||
|
||||
}
|
||||
$this->set('shipments', $this->paginate($conditions));
|
||||
$this->set('type', $type);
|
||||
|
||||
|
||||
$principles = $this->Shipment->Principle->find('list');
|
||||
$freightForwarders = $this->Shipment->FreightForwarder->find('list');
|
||||
|
|
@ -41,7 +85,7 @@ class ShipmentsController extends AppController {
|
|||
$shipmentType = $this->typeOptions(false);
|
||||
$shipmentTypeShort = $this->typeOptions(true);
|
||||
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
function edit($id = null) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class Shipment extends AppModel {
|
|||
'exclusive' => '',
|
||||
'finderQuery' => '',
|
||||
'counterQuery' => ''
|
||||
),
|
||||
),
|
||||
'ShipmentInvoice' => array(
|
||||
'className' => 'ShipmentInvoice',
|
||||
'foreignKey' => 'shipment_id',
|
||||
|
|
|
|||
121
views/elements/shipment_index_all.ctp
Normal file
121
views/elements/shipment_index_all.ctp
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
<table cellpadding="0" cellspacing="0" class="shipments">
|
||||
<tr>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
<th><?php echo $paginator->sort('date_arrived');?></th>
|
||||
<th><?php echo $paginator->sort('date_dispatched');?></th>
|
||||
<th><?php echo $paginator->sort('type');?></th>
|
||||
<th>Principle(s)</th>
|
||||
<th>PO(s)</th>
|
||||
<th>Jobs</th>
|
||||
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
||||
<th>Box Details<br>
|
||||
LxWxH (cm)
|
||||
</th>
|
||||
<th>Weight (kg)</th>
|
||||
<th><?php echo $paginator->sort('freight_forwarder_id');?></th>
|
||||
|
||||
|
||||
<th><?php echo $paginator->sort('airway_bill');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($shipments as $shipment):
|
||||
?>
|
||||
<tr>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Principle'] as $principle):?>
|
||||
<? if(!empty($principle['short_name'])) {
|
||||
echo $html->link($principle['short_name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
else {
|
||||
echo $html->link($principle['name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
?>
|
||||
|
||||
<br>
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['PurchaseOrder'] as $po):?>
|
||||
<?=$html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Job'] as $job):?>
|
||||
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['box_count']; ?>
|
||||
</td>
|
||||
|
||||
<td class="boxDimensions">
|
||||
|
||||
<?php
|
||||
|
||||
$totalWeight = 0;
|
||||
$weightString = '';
|
||||
|
||||
foreach($shipment['Box'] as $box):?>
|
||||
<?=$box['length']?>x<?=$box['width']?>x<?=$box['height']?><br>
|
||||
<?
|
||||
$weightString .= $box['weight'].' kg <br>';
|
||||
$totalWeight += $box['weight']; ?>
|
||||
<?php endforeach;?>
|
||||
|
||||
</td>
|
||||
|
||||
<td> <?
|
||||
|
||||
$boxCount = $shipment['Shipment']['box_count'];
|
||||
if($boxCount > 1) {
|
||||
echo $weightString;
|
||||
echo '<hr>';
|
||||
|
||||
}?>
|
||||
<? if($boxCount != 0): ?>
|
||||
<span class="totalWeight"><?=$totalWeight;?> kg</span></td>
|
||||
<? endif;?>
|
||||
<td>
|
||||
<?php echo $html->link($shipment['FreightForwarder']['name'], array('controller' => 'freight_forwarders', 'action' => 'view', $shipment['FreightForwarder']['id'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['airway_bill']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['comments']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
121
views/elements/shipment_index_direct.ctp
Normal file
121
views/elements/shipment_index_direct.ctp
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
<table cellpadding="0" cellspacing="0" class="shipments">
|
||||
<tr>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
<th><?php echo $paginator->sort('date_arrived');?></th>
|
||||
<th><?php echo $paginator->sort('date_dispatched');?></th>
|
||||
<th><?php echo $paginator->sort('type');?></th>
|
||||
<th>Principle(s)</th>
|
||||
<th>PO(s)</th>
|
||||
<th>Jobs</th>
|
||||
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
||||
<th>Box Details<br>
|
||||
LxWxH (cm)
|
||||
</th>
|
||||
<th>Weight (kg)</th>
|
||||
<th><?php echo $paginator->sort('freight_forwarder_id');?></th>
|
||||
|
||||
|
||||
<th><?php echo $paginator->sort('airway_bill');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($shipments as $shipment):
|
||||
?>
|
||||
<tr>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Principle'] as $principle):?>
|
||||
<? if(!empty($principle['short_name'])) {
|
||||
echo $html->link($principle['short_name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
else {
|
||||
echo $html->link($principle['name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
?>
|
||||
|
||||
<br>
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['PurchaseOrder'] as $po):?>
|
||||
<?=$html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Job'] as $job):?>
|
||||
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['box_count']; ?>
|
||||
</td>
|
||||
|
||||
<td class="boxDimensions">
|
||||
|
||||
<?php
|
||||
|
||||
$totalWeight = 0;
|
||||
$weightString = '';
|
||||
|
||||
foreach($shipment['Box'] as $box):?>
|
||||
<?=$box['length']?>x<?=$box['width']?>x<?=$box['height']?><br>
|
||||
<?
|
||||
$weightString .= $box['weight'].' kg <br>';
|
||||
$totalWeight += $box['weight']; ?>
|
||||
<?php endforeach;?>
|
||||
|
||||
</td>
|
||||
|
||||
<td> <?
|
||||
|
||||
$boxCount = $shipment['Shipment']['box_count'];
|
||||
if($boxCount > 1) {
|
||||
echo $weightString;
|
||||
echo '<hr>';
|
||||
|
||||
}?>
|
||||
<? if($boxCount != 0): ?>
|
||||
<span class="totalWeight"><?=$totalWeight;?> kg</span></td>
|
||||
<? endif;?>
|
||||
<td>
|
||||
<?php echo $html->link($shipment['FreightForwarder']['name'], array('controller' => 'freight_forwarders', 'action' => 'view', $shipment['FreightForwarder']['id'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['airway_bill']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['comments']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
121
views/elements/shipment_index_export.ctp
Normal file
121
views/elements/shipment_index_export.ctp
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
<table cellpadding="0" cellspacing="0" class="shipments">
|
||||
<tr>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
<th><?php echo $paginator->sort('date_arrived');?></th>
|
||||
<th><?php echo $paginator->sort('date_dispatched');?></th>
|
||||
<th><?php echo $paginator->sort('type');?></th>
|
||||
<th>Principle(s)</th>
|
||||
<th>PO(s)</th>
|
||||
<th>Jobs</th>
|
||||
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
||||
<th>Box Details<br>
|
||||
LxWxH (cm)
|
||||
</th>
|
||||
<th>Weight (kg)</th>
|
||||
<th><?php echo $paginator->sort('freight_forwarder_id');?></th>
|
||||
|
||||
|
||||
<th><?php echo $paginator->sort('airway_bill');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($shipments as $shipment):
|
||||
?>
|
||||
<tr>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Principle'] as $principle):?>
|
||||
<? if(!empty($principle['short_name'])) {
|
||||
echo $html->link($principle['short_name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
else {
|
||||
echo $html->link($principle['name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
?>
|
||||
|
||||
<br>
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['PurchaseOrder'] as $po):?>
|
||||
<?=$html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Job'] as $job):?>
|
||||
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['box_count']; ?>
|
||||
</td>
|
||||
|
||||
<td class="boxDimensions">
|
||||
|
||||
<?php
|
||||
|
||||
$totalWeight = 0;
|
||||
$weightString = '';
|
||||
|
||||
foreach($shipment['Box'] as $box):?>
|
||||
<?=$box['length']?>x<?=$box['width']?>x<?=$box['height']?><br>
|
||||
<?
|
||||
$weightString .= $box['weight'].' kg <br>';
|
||||
$totalWeight += $box['weight']; ?>
|
||||
<?php endforeach;?>
|
||||
|
||||
</td>
|
||||
|
||||
<td> <?
|
||||
|
||||
$boxCount = $shipment['Shipment']['box_count'];
|
||||
if($boxCount > 1) {
|
||||
echo $weightString;
|
||||
echo '<hr>';
|
||||
|
||||
}?>
|
||||
<? if($boxCount != 0): ?>
|
||||
<span class="totalWeight"><?=$totalWeight;?> kg</span></td>
|
||||
<? endif;?>
|
||||
<td>
|
||||
<?php echo $html->link($shipment['FreightForwarder']['name'], array('controller' => 'freight_forwarders', 'action' => 'view', $shipment['FreightForwarder']['id'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['airway_bill']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['comments']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
121
views/elements/shipment_index_import.ctp
Normal file
121
views/elements/shipment_index_import.ctp
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
<table cellpadding="0" cellspacing="0" class="shipments">
|
||||
<tr>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
<th><?php echo $paginator->sort('date_arrived');?></th>
|
||||
<th><?php echo $paginator->sort('date_dispatched');?></th>
|
||||
<th><?php echo $paginator->sort('type');?></th>
|
||||
<th>Principle(s)</th>
|
||||
<th>PO(s)</th>
|
||||
<th>Jobs</th>
|
||||
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
||||
<th>Box Details<br>
|
||||
LxWxH (cm)
|
||||
</th>
|
||||
<th>Weight (kg)</th>
|
||||
<th><?php echo $paginator->sort('freight_forwarder_id');?></th>
|
||||
|
||||
|
||||
<th><?php echo $paginator->sort('airway_bill');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($shipments as $shipment):
|
||||
?>
|
||||
<tr>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Principle'] as $principle):?>
|
||||
<? if(!empty($principle['short_name'])) {
|
||||
echo $html->link($principle['short_name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
else {
|
||||
echo $html->link($principle['name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
?>
|
||||
|
||||
<br>
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['PurchaseOrder'] as $po):?>
|
||||
<?=$html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Job'] as $job):?>
|
||||
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['box_count']; ?>
|
||||
</td>
|
||||
|
||||
<td class="boxDimensions">
|
||||
|
||||
<?php
|
||||
|
||||
$totalWeight = 0;
|
||||
$weightString = '';
|
||||
|
||||
foreach($shipment['Box'] as $box):?>
|
||||
<?=$box['length']?>x<?=$box['width']?>x<?=$box['height']?><br>
|
||||
<?
|
||||
$weightString .= $box['weight'].' kg <br>';
|
||||
$totalWeight += $box['weight']; ?>
|
||||
<?php endforeach;?>
|
||||
|
||||
</td>
|
||||
|
||||
<td> <?
|
||||
|
||||
$boxCount = $shipment['Shipment']['box_count'];
|
||||
if($boxCount > 1) {
|
||||
echo $weightString;
|
||||
echo '<hr>';
|
||||
|
||||
}?>
|
||||
<? if($boxCount != 0): ?>
|
||||
<span class="totalWeight"><?=$totalWeight;?> kg</span></td>
|
||||
<? endif;?>
|
||||
<td>
|
||||
<?php echo $html->link($shipment['FreightForwarder']['name'], array('controller' => 'freight_forwarders', 'action' => 'view', $shipment['FreightForwarder']['id'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['airway_bill']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['comments']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
121
views/elements/shipment_index_local.ctp
Normal file
121
views/elements/shipment_index_local.ctp
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
<table cellpadding="0" cellspacing="0" class="shipments">
|
||||
<tr>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
<th><?php echo $paginator->sort('date_arrived');?></th>
|
||||
<th><?php echo $paginator->sort('date_dispatched');?></th>
|
||||
<th><?php echo $paginator->sort('type');?></th>
|
||||
<th>Principle(s)</th>
|
||||
<th>PO(s)</th>
|
||||
<th>Jobs</th>
|
||||
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
||||
<th>Box Details<br>
|
||||
LxWxH (cm)
|
||||
</th>
|
||||
<th>Weight (kg)</th>
|
||||
<th><?php echo $paginator->sort('freight_forwarder_id');?></th>
|
||||
|
||||
|
||||
<th><?php echo $paginator->sort('airway_bill');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($shipments as $shipment):
|
||||
?>
|
||||
<tr>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Principle'] as $principle):?>
|
||||
<? if(!empty($principle['short_name'])) {
|
||||
echo $html->link($principle['short_name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
else {
|
||||
echo $html->link($principle['name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
?>
|
||||
|
||||
<br>
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['PurchaseOrder'] as $po):?>
|
||||
<?=$html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Job'] as $job):?>
|
||||
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['box_count']; ?>
|
||||
</td>
|
||||
|
||||
<td class="boxDimensions">
|
||||
|
||||
<?php
|
||||
|
||||
$totalWeight = 0;
|
||||
$weightString = '';
|
||||
|
||||
foreach($shipment['Box'] as $box):?>
|
||||
<?=$box['length']?>x<?=$box['width']?>x<?=$box['height']?><br>
|
||||
<?
|
||||
$weightString .= $box['weight'].' kg <br>';
|
||||
$totalWeight += $box['weight']; ?>
|
||||
<?php endforeach;?>
|
||||
|
||||
</td>
|
||||
|
||||
<td> <?
|
||||
|
||||
$boxCount = $shipment['Shipment']['box_count'];
|
||||
if($boxCount > 1) {
|
||||
echo $weightString;
|
||||
echo '<hr>';
|
||||
|
||||
}?>
|
||||
<? if($boxCount != 0): ?>
|
||||
<span class="totalWeight"><?=$totalWeight;?> kg</span></td>
|
||||
<? endif;?>
|
||||
<td>
|
||||
<?php echo $html->link($shipment['FreightForwarder']['name'], array('controller' => 'freight_forwarders', 'action' => 'view', $shipment['FreightForwarder']['id'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['airway_bill']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['comments']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
|
@ -77,7 +77,11 @@
|
|||
|
||||
<li><?php echo $html->link('Shipments','/shipments/index');?>
|
||||
<ul>
|
||||
<li class=""><?php echo $html->link('Shipments List', '/shipments/index');?></li>
|
||||
<li class=""><?php echo $html->link('All Shipments', '/shipments/index');?></li>
|
||||
<li class=""><?php echo $html->link('Import Shipments', '/shipments/index/import');?></li>
|
||||
<li class=""><?php echo $html->link('Direct Shipments', '/shipments/index/direct');?></li>
|
||||
<li class=""><?php echo $html->link('Export Shipments', '/shipments/index/export');?></li>
|
||||
<li class="last"><?php echo $html->link('Local Shipments', '/shipments/index/local');?></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ echo $form->input('id', array('type'=>'hidden'));
|
|||
</div>
|
||||
|
||||
<div id="customer" class="hiddenDefault">
|
||||
<?=$form->input('customer', array('id'=>'customer_autocomplete', 'label'=>'Customer', 'value'=>$this->data['Shipment']['customer_id']));?>
|
||||
<?=$form->input('customer', array('id'=>'customer_autocomplete', 'label'=>'Customer', 'value'=>$this->data['Customer']['name']));?>
|
||||
<?=$form->input('customer_id', array('type'=>'hidden', 'id'=>'customer_id', 'value'=>$this->data['Shipment']['customer_id']));?>
|
||||
</div>
|
||||
|
||||
|
|
@ -83,6 +83,8 @@ echo $form->input('id', array('type'=>'hidden'));
|
|||
</div>
|
||||
<div id="address" class="hiddenDefault">
|
||||
<?=$form->input('address_id', array('type'=>'hidden', 'id'=>'address_id', 'value'=>$this->data['Shipment']['address_id']));?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="shipments index">
|
||||
<h2><?php __('Shipments');?></h2>
|
||||
<h2><?php echo ucfirst($type) .' Shipments'?></h2>
|
||||
|
||||
|
||||
<?php echo $javascript->link('shipment_index');?>
|
||||
|
|
@ -10,134 +10,18 @@
|
|||
));
|
||||
?></p>
|
||||
<button class="newShipment">New Shipment</button>
|
||||
<table cellpadding="0" cellspacing="0" class="shipments">
|
||||
<tr>
|
||||
<th><?php echo $paginator->sort('user_id');?></th>
|
||||
<th><?php echo $paginator->sort('date_arrived');?></th>
|
||||
<th><?php echo $paginator->sort('date_dispatched');?></th>
|
||||
<th><?php echo $paginator->sort('type');?></th>
|
||||
<th>Principle(s)</th>
|
||||
<th>PO(s)</th>
|
||||
<th>Jobs</th>
|
||||
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
||||
<th>Box Details<br>
|
||||
LxWxH (cm)
|
||||
</th>
|
||||
<th>Weight (kg)</th>
|
||||
<th><?php echo $paginator->sort('freight_forwarder_id');?></th>
|
||||
|
||||
|
||||
<th><?php echo $paginator->sort('airway_bill');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($shipments as $shipment):
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?
|
||||
$initials = $shipment['User']['first_name'][0].$shipment['User']['last_name'][0];
|
||||
|
||||
echo $html->link($initials, array('controller'=> 'users', 'action'=>'view', $shipment['User']['id'])); ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Principle'] as $principle):?>
|
||||
<? if(!empty($principle['short_name'])) {
|
||||
echo $html->link($principle['short_name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
else {
|
||||
echo $html->link($principle['name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
||||
}
|
||||
?>
|
||||
|
||||
<br>
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['PurchaseOrder'] as $po):?>
|
||||
<?=$html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php foreach($shipment['Job'] as $job):?>
|
||||
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
||||
<br>
|
||||
<?endforeach;?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['box_count']; ?>
|
||||
</td>
|
||||
|
||||
<td class="boxDimensions">
|
||||
|
||||
<?php
|
||||
|
||||
$totalWeight = 0;
|
||||
$weightString = '';
|
||||
|
||||
foreach($shipment['Box'] as $box):?>
|
||||
<?=$box['length']?>x<?=$box['width']?>x<?=$box['height']?><br>
|
||||
<?
|
||||
$weightString .= $box['weight'].' kg <br>';
|
||||
$totalWeight += $box['weight']; ?>
|
||||
<?php endforeach;?>
|
||||
|
||||
</td>
|
||||
|
||||
<td> <?
|
||||
|
||||
$boxCount = $shipment['Shipment']['box_count'];
|
||||
if($boxCount > 1) {
|
||||
echo $weightString;
|
||||
echo '<hr>';
|
||||
|
||||
}?>
|
||||
<? if($boxCount != 0): ?>
|
||||
<span class="totalWeight"><?=$totalWeight;?> kg</span></td>
|
||||
<? endif;?>
|
||||
<td>
|
||||
<?php echo $html->link($shipment['FreightForwarder']['name'], array('controller' => 'freight_forwarders', 'action' => 'view', $shipment['FreightForwarder']['id'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['airway_bill']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $shipment['Shipment']['comments']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<div class="scrollHorizontal">
|
||||
<?=$this->element('shipment_index_'.$type);?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="paging">
|
||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||
| <?php echo $paginator->numbers();?>
|
||||
| <?php echo $paginator->numbers();?>
|
||||
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
|
|
@ -146,7 +30,6 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="add-form" title="New Shipment">
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ h2 {
|
|||
color: #e32;
|
||||
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
|
||||
font-size: 190%;
|
||||
margin: 0.3em 0;
|
||||
margin: 0;
|
||||
/* padding-top: 0.8em; */
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ a.headerlinks {
|
|||
h3 {
|
||||
color: #2C5FD5;
|
||||
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
|
||||
font-size: 165%;
|
||||
font-size: 130%;
|
||||
/* padding-top: 1.5em; */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue