Shipment register 95 complete
This commit is contained in:
parent
6188e20090
commit
1eb297b035
|
|
@ -47,15 +47,24 @@ class FreightForwardersController extends AppController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete($id = null) {
|
|
||||||
if (!$id) {
|
function ajax_add() {
|
||||||
$this->Session->setFlash(__('Invalid id for FreightForwarder', true));
|
$this->layout = 'ajax';
|
||||||
$this->redirect(array('action'=>'index'));
|
if(!empty($this->data['Shipment']['newFreightForwarderName'])) {
|
||||||
|
$this->FreightForwarder->create();
|
||||||
|
$this->data['FreightForwarder']['name'] = trim($this->data['Shipment']['newFreightForwarderName']);
|
||||||
|
if($this->FreightForwarder->save($this->data['FreightForwarder'])) {
|
||||||
|
echo "SUCCESS";
|
||||||
}
|
}
|
||||||
if ($this->FreightForwarder->del($id)) {
|
else {
|
||||||
$this->Session->setFlash(__('FreightForwarder deleted', true));
|
echo "FAIL";
|
||||||
$this->redirect(array('action'=>'index'));
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_options() {
|
||||||
|
$this->layout = 'ajax';
|
||||||
|
$this->set('freight_forwarders',$this->FreightForwarder->find('list'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@ class ShipmentInvoicesController extends AppController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$shipments = $this->ShipmentInvoice->Shipment->find('list');
|
$shipments = $this->ShipmentInvoice->Shipment->find('list');
|
||||||
$freight_forwarders = $this->ShipmentInvoice->FreightForwarder->find('list');
|
|
||||||
$principles = $this->ShipmentInvoice->Principle->find('list');
|
$principles = $this->ShipmentInvoice->Principle->find('list');
|
||||||
$currencies = $this->ShipmentInvoice->Currency->find('list');
|
$currencies = $this->ShipmentInvoice->Currency->find('list');
|
||||||
$this->set(compact('shipments', 'principles', 'currencies', 'freight_forwarders'));
|
$freightForwarders = $this->ShipmentInvoice->FreightForwarder->find('list');
|
||||||
|
$this->set(compact('shipments', 'principles', 'currencies', 'freightForwarders'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit($id = null) {
|
function edit($id = null) {
|
||||||
|
|
@ -53,7 +53,8 @@ class ShipmentInvoicesController extends AppController {
|
||||||
$shipments = $this->ShipmentInvoice->Shipment->find('list');
|
$shipments = $this->ShipmentInvoice->Shipment->find('list');
|
||||||
$principles = $this->ShipmentInvoice->Principle->find('list');
|
$principles = $this->ShipmentInvoice->Principle->find('list');
|
||||||
$currencies = $this->ShipmentInvoice->Currency->find('list');
|
$currencies = $this->ShipmentInvoice->Currency->find('list');
|
||||||
$this->set(compact('shipments','principles','currencies'));
|
$freightForwarders = $this->ShipmentInvoice->FreightForwarder->find('list');
|
||||||
|
$this->set(compact('shipments','principles','currencies','freightForwarders'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete($id = null) {
|
function delete($id = null) {
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,9 @@ class ShipmentsController extends AppController {
|
||||||
$freightForwarders = $this->Shipment->FreightForwarder->find('list');
|
$freightForwarders = $this->Shipment->FreightForwarder->find('list');
|
||||||
$shipmentType = $this->typeOptions(false);
|
$shipmentType = $this->typeOptions(false);
|
||||||
$shipmentTypeShort = $this->typeOptions(true);
|
$shipmentTypeShort = $this->typeOptions(true);
|
||||||
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort'));
|
$currencies = $this->Shipment->ShipmentInvoice->Currency->find('list');
|
||||||
|
|
||||||
|
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort', 'currencies'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -84,7 +86,10 @@ class ShipmentsController extends AppController {
|
||||||
$freightForwarders = $this->Shipment->FreightForwarder->find('list');
|
$freightForwarders = $this->Shipment->FreightForwarder->find('list');
|
||||||
$shipmentType = $this->typeOptions(false);
|
$shipmentType = $this->typeOptions(false);
|
||||||
$shipmentTypeShort = $this->typeOptions(true);
|
$shipmentTypeShort = $this->typeOptions(true);
|
||||||
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort'));
|
$currencies = $this->Shipment->ShipmentInvoice->Currency->find('list');
|
||||||
|
$invoiceType = $this->invoiceTypeOptions();
|
||||||
|
$this->set('yesNo', array(0=>'No', 1=>'Yes'));
|
||||||
|
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort', 'currencies','invoiceType', 'yesNo'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,7 +102,8 @@ class ShipmentsController extends AppController {
|
||||||
$freightForwarders = $this->Shipment->FreightForwarder->find('list');
|
$freightForwarders = $this->Shipment->FreightForwarder->find('list');
|
||||||
$shipmentType = $this->typeOptions(false);
|
$shipmentType = $this->typeOptions(false);
|
||||||
$shipmentTypeShort = $this->typeOptions(true);
|
$shipmentTypeShort = $this->typeOptions(true);
|
||||||
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort'));
|
$currencies = $this->Shipment->ShipmentInvoice->Currency->find('list');
|
||||||
|
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort', 'currencies'));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -116,13 +122,14 @@ class ShipmentsController extends AppController {
|
||||||
$boxIDs = array();
|
$boxIDs = array();
|
||||||
foreach($this->data['Box'] as $box) {
|
foreach($this->data['Box'] as $box) {
|
||||||
$boxIDs[] = $box['id'];
|
$boxIDs[] = $box['id'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$invoiceIDs = array();
|
$invoiceIDs = array();
|
||||||
foreach($this->data['ShipmentInvoice'] as $si) {
|
foreach($this->data['ShipmentInvoice'] as $si) {
|
||||||
$invoiceIDs[] = $si['id'];
|
$invoiceIDs[] = $si['id'];
|
||||||
}
|
}
|
||||||
|
print_r($boxIDs);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -173,6 +180,12 @@ class ShipmentsController extends AppController {
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function invoiceTypeOptions() {
|
||||||
|
$options = array('', 'Freight','Customs','Principle');
|
||||||
|
return $options;
|
||||||
|
}
|
||||||
|
|
||||||
function typeOptions($short = false) {
|
function typeOptions($short = false) {
|
||||||
if($short == false) {
|
if($short == false) {
|
||||||
$options = array('','Import: Principle to CMC','Direct: Principle to Customer','Export','Local');
|
$options = array('','Import: Principle to CMC','Direct: Principle to Customer','Export','Local');
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,11 @@ class Job extends AppModel {
|
||||||
'Email' => array(
|
'Email' => array(
|
||||||
'className' => 'Email',
|
'className' => 'Email',
|
||||||
'joinTable' => 'emails_jobs',
|
'joinTable' => 'emails_jobs',
|
||||||
|
),
|
||||||
|
|
||||||
|
'Shipment' => array(
|
||||||
|
'className' => 'Shipment',
|
||||||
|
'joinTable' => 'shipments_jobs',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,6 @@
|
||||||
class ShipmentInvoice extends AppModel {
|
class ShipmentInvoice extends AppModel {
|
||||||
|
|
||||||
var $name = 'ShipmentInvoice';
|
var $name = 'ShipmentInvoice';
|
||||||
/*var $validate = array(
|
|
||||||
'shipment_id' => array('numeric'),
|
|
||||||
'principle_id' => array('numeric'),
|
|
||||||
'currency_id' => array('numeric'),
|
|
||||||
'invoice_number' => array('notempty'),
|
|
||||||
'approved' => array('numeric')
|
|
||||||
);*/
|
|
||||||
|
|
||||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||||
var $belongsTo = array(
|
var $belongsTo = array(
|
||||||
|
|
@ -18,7 +11,7 @@ class ShipmentInvoice extends AppModel {
|
||||||
'conditions' => '',
|
'conditions' => '',
|
||||||
'fields' => '',
|
'fields' => '',
|
||||||
'order' => '',
|
'order' => '',
|
||||||
'counterCache'=>true
|
'counterCache' => 'shipment_invoice_count',
|
||||||
),
|
),
|
||||||
'Principle' => array(
|
'Principle' => array(
|
||||||
'className' => 'Principle',
|
'className' => 'Principle',
|
||||||
|
|
@ -27,17 +20,19 @@ class ShipmentInvoice extends AppModel {
|
||||||
'fields' => '',
|
'fields' => '',
|
||||||
'order' => ''
|
'order' => ''
|
||||||
),
|
),
|
||||||
|
|
||||||
'FreightForwarder' => array(
|
|
||||||
'className' => 'FreightForwarder',
|
|
||||||
'foreignKey' => 'freight_forwarder_id'
|
|
||||||
),
|
|
||||||
'Currency' => array(
|
'Currency' => array(
|
||||||
'className' => 'Currency',
|
'className' => 'Currency',
|
||||||
'foreignKey' => 'currency_id',
|
'foreignKey' => 'currency_id',
|
||||||
'conditions' => '',
|
'conditions' => '',
|
||||||
'fields' => '',
|
'fields' => '',
|
||||||
'order' => ''
|
'order' => ''
|
||||||
|
),
|
||||||
|
'FreightForwarder' => array(
|
||||||
|
'className' => 'FreightForwarder',
|
||||||
|
'foreignKey' => 'freight_forwarder_id',
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => ''
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
186
views/elements/add_edit_shipment.ctp
Normal file
186
views/elements/add_edit_shipment.ctp
Normal file
|
|
@ -0,0 +1,186 @@
|
||||||
|
<?php echo $form->create('Shipment', array('default'=>false));?>
|
||||||
|
<?php
|
||||||
|
echo $form->input('user_id', array('type'=>'hidden', 'value'=>$currentuser['User']['id']));
|
||||||
|
echo $form->input('type', array('options'=>$shipmentType, 'id'=>'shipmentType'));
|
||||||
|
echo $form->input('id', array('type'=>'hidden'));
|
||||||
|
?>
|
||||||
|
<div id="importFields" class="hiddenDefault">
|
||||||
|
<?
|
||||||
|
echo $form->input('date_arrived_display', array('label'=>'Date Arrived', 'id'=>'date_arrived_display', 'value'=>$this->element('isEmptyDate', array('date'=>$this->data['Shipment']['date_arrived']))));
|
||||||
|
echo $form->input('date_arrived', array('type'=>'hidden', 'id'=>'date_arrived'));
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="dateDispatched" class="hiddenDefault">
|
||||||
|
<?
|
||||||
|
echo $form->input('date_dispatched_display', array('label'=>'Date Dispatched', 'id'=>'date_dispatched_display', 'value'=>$this->element('isEmptyDate', array('date'=>$this->data['Shipment']['date_dispatched']))));
|
||||||
|
|
||||||
|
echo $form->input('date_dispatched', array('type'=>'hidden', 'id'=>'date_dispatched'));
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="principle" class="hiddenDefault">
|
||||||
|
<? echo $form->input('Principle', array('name'=>'PrincipleSelect', 'type'=>'select', 'multiple'=>false)); ?>
|
||||||
|
<button id="addPrinciple">Add Principle to this Shipment</button>
|
||||||
|
<ul id="principlesList" class="habtmList">
|
||||||
|
<?php foreach($this->data['Principle'] as $principle):?>
|
||||||
|
<li id="PrincipleID_<?=$principle['id']?>">
|
||||||
|
<button class="removeFromList">X</button>
|
||||||
|
<?=$principle['name'];?>
|
||||||
|
<input type="hidden" name="data[Principle][Principle][]" value="<?=$principle['id']?>">
|
||||||
|
</li>
|
||||||
|
<?php endforeach?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="purchaseOrder" class="hiddenDefault">
|
||||||
|
<?
|
||||||
|
echo $form->input('purchase_order', array('id'=>'purchase_order_autocomplete' ,'label'=>'Purchase Order (start typing and select from the list)'));?>
|
||||||
|
|
||||||
|
<ul id="purchaseOrdersList" class="habtmList">
|
||||||
|
<?php foreach($this->data['PurchaseOrder'] as $po):?>
|
||||||
|
<li id="PurchaseOrderID_<?=$po['id']?>">
|
||||||
|
<button class="removeFromList">X</button>
|
||||||
|
<?=$po['title'];?>
|
||||||
|
<input type="hidden" name="data[PurchaseOrder][PurchaseOrder][]" value="<?=$po['id']?>">
|
||||||
|
</li>
|
||||||
|
<?php endforeach?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="job" class="hiddenDefault">
|
||||||
|
<?
|
||||||
|
echo $form->input('job', array('id'=>'job_autocomplete'));
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<ul id="jobsList" class="habtmList">
|
||||||
|
<?php foreach($this->data['Job'] as $job):?>
|
||||||
|
<li id="JobID_<?=$job['id']?>">
|
||||||
|
<button class="removeFromList">X</button>
|
||||||
|
<?=$job['title'];?>
|
||||||
|
<input type="hidden" name="data[Job][Job][]" value="<?=$job['id']?>">
|
||||||
|
</li>
|
||||||
|
<?php endforeach?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="customer" class="hiddenDefault">
|
||||||
|
<?=$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>
|
||||||
|
|
||||||
|
<div id="addressSpan" class="hiddenDefault">
|
||||||
|
<span>Shipping Address:</span>
|
||||||
|
</div>
|
||||||
|
<div id="address" class="hiddenDefault">
|
||||||
|
<?=$form->input('address_id', array('type'=>'hidden', 'id'=>'address_id', 'value'=>$this->data['Shipment']['address_id']));?>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="freight_forwarder" class="hiddenDefault">
|
||||||
|
<?=$form->input('freight_forwarder_id');?>
|
||||||
|
|
||||||
|
<button class="addFreightForwarder hiddenDefault">Add Freight Forwarder</button>
|
||||||
|
<div id="newFreightForwarderDiv" class="hiddenDefault">
|
||||||
|
<?=$form->input('newFreightForwarderName');?>
|
||||||
|
<button class="saveNewFF">Save</button>
|
||||||
|
<button class="cancelNewFF">Cancel</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="airway_bill" class="hiddenDefault">
|
||||||
|
<?=$form->input('airway_bill');?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="boxes" class="hiddenDefault">
|
||||||
|
<button id="addBox">Add Box</button>
|
||||||
|
|
||||||
|
<?php $boxNo = 0;?>
|
||||||
|
<?php foreach($this->data['Box'] as $box):?>
|
||||||
|
<div id="" class="boxForm">
|
||||||
|
<button class="removeBox">X</button>
|
||||||
|
<?=$form->input("Box.{$boxNo}.id", array('type'=>'hidden'));?>
|
||||||
|
<?=$form->input("Box.{$boxNo}.shipment_id", array('type'=>'hidden', 'value'=>$this->data['Shipment']['id']));?>
|
||||||
|
<?=$form->input("Box.{$boxNo}.length", array('label'=>'Length (cm)', 'div'=>'length'));?>
|
||||||
|
<?=$form->input("Box.{$boxNo}.width", array('label'=>'Width (cm)', 'div'=>'width'));?>
|
||||||
|
<?=$form->input("Box.{$boxNo}.height", array('label'=>'Height (cm)', 'div'=>'height'));?>
|
||||||
|
<?=$form->input("Box.{$boxNo}.weight", array('label'=>'Weight (kg)', 'div'=>'weight'));?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
$boxNo++;
|
||||||
|
endforeach;?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="invoices" class="hiddenDefault">
|
||||||
|
|
||||||
|
|
||||||
|
<button id="addInvoice">Add Invoice</button>
|
||||||
|
<?
|
||||||
|
$invNo = 0;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?
|
||||||
|
foreach($this->data['ShipmentInvoice'] as $invoice):?>
|
||||||
|
<div class="invForm">
|
||||||
|
<button class="removeInvoice">X</button>
|
||||||
|
<?
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.id", array('type'=>'hidden'));
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.shipment_id", array('type'=>'hidden', 'value'=>$this->data['Shipment']['id']));
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.currency_id");
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.freight_forwarder_id");
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.invoice_number");
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.invoice_amount");
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.gst_amount");
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.deferred_gst");
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.approved");
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.paid");
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.date_paid");
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.invoice_type");
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<?
|
||||||
|
$invNo++;
|
||||||
|
endforeach;?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="comments" class="hiddenDefault">
|
||||||
|
<?=$form->input('comments');?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?php echo $form->end();?>
|
||||||
|
<div id="boxFactory" class="hiddenDefault">
|
||||||
|
<?=$form->input('length', array('label'=>'Length (cm)', 'div'=>'length'));?>
|
||||||
|
<?=$form->input('width', array('label'=>'Width (cm)', 'div'=>'width'));?>
|
||||||
|
<?=$form->input('height', array('label'=>'Height (cm)', 'div'=>'height'));?>
|
||||||
|
<?=$form->input('weight', array('label'=>'Weight (kg)', 'div'=>'weight'));?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="invoiceFactory" class="hiddenDefault">
|
||||||
|
<?
|
||||||
|
echo $form->input("invoice_type", array('type'=>'select','label'=>'Invoice Type', 'div'=>'inv_invoice_type', 'options'=>$invoiceType));
|
||||||
|
echo $form->input("currency_id",array('label'=>'Currency', 'div'=>'inv_currency_id', 'options'=>$currencies));
|
||||||
|
echo $form->input("freight_forwarder_id", array('label'=>'Freight Forwarder', 'div'=>'inv_freight_forwarder_id', 'options'=>$freightForwarders));
|
||||||
|
echo $form->input("invoice_number", array('label'=>'Invoice Number', 'div'=>'inv_invoice_number'));
|
||||||
|
echo $form->input("invoice_amount", array('label'=>'Invoice Amount', 'div'=>'inv_invoice_amount'));
|
||||||
|
echo $form->input("gst_amount", array('label'=>'GST Amount', 'div'=>'inv_gst_amount'));
|
||||||
|
echo $form->input("deferred_gst", array('label'=>'Deferred GST?', 'div'=>'inv_deferred_gst', 'options'=>$yesNo));
|
||||||
|
echo $form->input("deferred_gst_amount", array('label'=>'Deferred GST Amount', 'div'=>'inv_deferred_gst_amount'));
|
||||||
|
echo $form->input("approved", array('label'=>'Approved', 'div'=>'inv_approved'));
|
||||||
|
echo $form->input("paid", array('label'=>'Paid', 'div'=>'inv_paid'));
|
||||||
|
echo $form->input("date_paid", array('label'=>'Date Paid', 'div'=>'inv_date_paid'));
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
<?php echo $form->create('Shipment', array('default'=>false));?>
|
|
||||||
<?php
|
|
||||||
echo $form->input('user_id', array('type'=>'hidden', 'value'=>$currentuser['User']['id']));
|
|
||||||
echo $form->input('type', array('options'=>$shipmentType, 'id'=>'shipmentType'));
|
|
||||||
echo $form->input('id', array('type'=>'hidden'));
|
|
||||||
?>
|
|
||||||
<div id="importFields" class="hiddenDefault">
|
|
||||||
<?
|
|
||||||
echo $form->input('date_arrived_display', array('label'=>'Date Arrived', 'id'=>'date_arrived_display'));
|
|
||||||
echo $form->input('date_arrived', array('type'=>'hidden', 'id'=>'date_arrived'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="dateDispatched" class="hiddenDefault">
|
|
||||||
<?
|
|
||||||
echo $form->input('date_dispatched_display', array('label'=>'Date dispatched', 'id'=>'date_dispatched_display'));
|
|
||||||
echo $form->input('date_dispatched', array('type'=>'hidden', 'id'=>'date_dispatched'));
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="principle" class="hiddenDefault">
|
|
||||||
<? echo $form->input('Principle', array('name'=>'PrincipleSelect', 'type'=>'select', 'multiple'=>false)); ?>
|
|
||||||
<button id="addPrinciple">Add Principle</button>
|
|
||||||
<ul id="principlesList" class="habtmList">
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="purchaseOrder" class="hiddenDefault">
|
|
||||||
<?
|
|
||||||
echo $form->input('purchase_order', array('id'=>'purchase_order_autocomplete'));?>
|
|
||||||
|
|
||||||
<ul id="purchaseOrdersList" class="habtmList">
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="job" class="hiddenDefault">
|
|
||||||
<?
|
|
||||||
echo $form->input('job', array('id'=>'job_autocomplete'));
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<ul id="jobsList" class="habtmList">
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="customer" class="hiddenDefault">
|
|
||||||
<?=$form->input('customer', array('id'=>'customer_autocomplete', 'label'=>'Customer'));?>
|
|
||||||
<?=$form->input('customer_id', array('type'=>'hidden', 'id'=>'customer_id'));?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="addressSpan" class="hiddenDefault">
|
|
||||||
<span>Shipping Address:</span>
|
|
||||||
</div>
|
|
||||||
<div id="address" class="hiddenDefault">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="freight_forwarder" class="hiddenDefault">
|
|
||||||
<?=$form->input('freight_forwarder_id');?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="airway_bill" class="hiddenDefault">
|
|
||||||
<?=$form->input('airway_bill');?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="boxes" class="hiddenDefault">
|
|
||||||
<button id="addBox">Add Box</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="comments" class="hiddenDefault">
|
|
||||||
<?=$form->input('comments');?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?php echo $form->end();?>
|
|
||||||
|
|
||||||
<div id="boxFactory" class="hiddenDefault">
|
|
||||||
<?=$form->input('Box.0.length', array('label'=>'Length (cm)', 'div'=>'length'));?>
|
|
||||||
<?=$form->input('Box.0.width', array('label'=>'Width (cm)', 'div'=>'width'));?>
|
|
||||||
<?=$form->input('Box.0.height', array('label'=>'Height (cm)', 'div'=>'height'));?>
|
|
||||||
<?=$form->input('Box.0.weight', array('label'=>'Weight (kg)', 'div'=>'weight'));?>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if($date == "0000-00-00") {
|
if(empty($date)) {
|
||||||
echo "";
|
echo "";
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
echo date("j M Y", strtotime($date));
|
else if($date == "0000-00-00") {
|
||||||
}
|
echo "";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo date("j M Y", strtotime($date));
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,16 @@
|
||||||
</th>
|
</th>
|
||||||
<th>Weight (kg)</th>
|
<th>Weight (kg)</th>
|
||||||
<th><?php echo $paginator->sort('freight_forwarder_id');?></th>
|
<th><?php echo $paginator->sort('freight_forwarder_id');?></th>
|
||||||
|
|
||||||
|
|
||||||
<th><?php echo $paginator->sort('airway_bill');?></th>
|
<th><?php echo $paginator->sort('airway_bill');?></th>
|
||||||
|
<th># Invoices</th>
|
||||||
|
<th>Issued By</th>
|
||||||
|
<th>Invoice Amount</th>
|
||||||
|
<th>Deferred GST</th>
|
||||||
|
<th>Approved?</th>
|
||||||
|
<th>Paid?</th>
|
||||||
|
<th>Date Paid</th>
|
||||||
|
|
||||||
|
|
||||||
<th><?php echo $paginator->sort('comments');?></th>
|
<th><?php echo $paginator->sort('comments');?></th>
|
||||||
<th class="actions"><?php __('Actions');?></th>
|
<th class="actions"><?php __('Actions');?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -110,6 +117,20 @@
|
||||||
<td>
|
<td>
|
||||||
<?php echo $shipment['Shipment']['airway_bill']; ?>
|
<?php echo $shipment['Shipment']['airway_bill']; ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?=$shipment['Shipment']['shipment_invoice_count'];?>
|
||||||
|
</td>
|
||||||
|
<td>Issued By Principle/FF name
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>Invoice amount</td>
|
||||||
|
<td>Deferred GST amount</td>
|
||||||
|
|
||||||
|
<td>Approved?</td>
|
||||||
|
<td>Paid</td>
|
||||||
|
<td>Date Paid</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?php echo $shipment['Shipment']['comments']; ?>
|
<?php echo $shipment['Shipment']['comments']; ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<table cellpadding="0" cellspacing="0" class="shipments">
|
<table cellpadding="0" cellspacing="0" class="shipments">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="actions"><?php __('Actions');?></th>
|
<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('date_dispatched');?></th>
|
||||||
<th><?php echo $paginator->sort('type');?></th>
|
<th><?php echo $paginator->sort('type');?></th>
|
||||||
<th>Principle(s)</th>
|
<th>Principle(s)</th>
|
||||||
|
|
@ -28,11 +27,6 @@
|
||||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,9 @@
|
||||||
<table cellpadding="0" cellspacing="0" class="shipments">
|
<table cellpadding="0" cellspacing="0" class="shipments">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="actions"><?php __('Actions');?></th>
|
<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('date_dispatched');?></th>
|
||||||
<th><?php echo $paginator->sort('type');?></th>
|
<th><?php echo $paginator->sort('type');?></th>
|
||||||
<th>Principle(s)</th>
|
<th>Job(s)</th>
|
||||||
<th>PO(s)</th>
|
|
||||||
<th>Jobs</th>
|
|
||||||
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
||||||
<th>Box Details<br>
|
<th>Box Details<br>
|
||||||
LxWxH (cm)
|
LxWxH (cm)
|
||||||
|
|
@ -28,11 +25,6 @@
|
||||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
||||||
|
|
@ -43,27 +35,6 @@
|
||||||
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
||||||
</td>
|
</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>
|
<td>
|
||||||
<?php foreach($shipment['Job'] as $job):?>
|
<?php foreach($shipment['Job'] as $job):?>
|
||||||
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th class="actions"><?php __('Actions');?></th>
|
<th class="actions"><?php __('Actions');?></th>
|
||||||
<th><?php echo $paginator->sort('date_arrived');?></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><?php echo $paginator->sort('type');?></th>
|
||||||
<th>Principle(s)</th>
|
<th>Principle(s)</th>
|
||||||
<th>PO(s)</th>
|
<th>PO(s)</th>
|
||||||
<th>Jobs</th>
|
|
||||||
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
||||||
<th>Box Details<br>
|
<th>Box Details<br>
|
||||||
LxWxH (cm)
|
LxWxH (cm)
|
||||||
|
|
@ -33,11 +31,6 @@
|
||||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
||||||
|
|
@ -64,12 +57,6 @@
|
||||||
<?endforeach;?>
|
<?endforeach;?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
|
||||||
<?php foreach($shipment['Job'] as $job):?>
|
|
||||||
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
|
||||||
<br>
|
|
||||||
<?endforeach;?>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?php echo $shipment['Shipment']['box_count']; ?>
|
<?php echo $shipment['Shipment']['box_count']; ?>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
<table cellpadding="0" cellspacing="0" class="shipments">
|
<table cellpadding="0" cellspacing="0" class="shipments">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="actions"><?php __('Actions');?></th>
|
<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('date_dispatched');?></th>
|
||||||
<th><?php echo $paginator->sort('type');?></th>
|
<th><?php echo $paginator->sort('type');?></th>
|
||||||
<th>Principle(s)</th>
|
|
||||||
<th>PO(s)</th>
|
|
||||||
<th>Jobs</th>
|
<th>Jobs</th>
|
||||||
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
||||||
<th>Box Details<br>
|
<th>Box Details<br>
|
||||||
|
|
@ -28,11 +25,6 @@
|
||||||
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
<button id="<?=$shipment['Shipment']['id']?>" class="editButton">Edit</button>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
||||||
|
|
@ -43,27 +35,6 @@
|
||||||
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
||||||
</td>
|
</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>
|
<td>
|
||||||
<?php foreach($shipment['Job'] as $job):?>
|
<?php foreach($shipment['Job'] as $job):?>
|
||||||
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
||||||
|
|
|
||||||
|
|
@ -56,11 +56,6 @@
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo $html->link(__('Edit Job', true), array('action' => 'edit', $job['Job']['id'])); ?> </li>
|
<li><?php echo $html->link(__('Edit Job', true), array('action' => 'edit', $job['Job']['id'])); ?> </li>
|
||||||
<li><?php echo $html->link(__('Delete Job', true), array('action' => 'delete', $job['Job']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $job['Job']['id'])); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('List Jobs', true), array('action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Job', true), array('action' => 'add')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('List Enquiries', true), array('controller' => 'enquiries', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller' => 'enquiries', 'action' => 'add')); ?> </li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
<th>Net Sales AUD</th>
|
<th>Net Sales AUD</th>
|
||||||
<th>Gross Profit AUD</th>
|
<th>Gross Profit AUD</th>
|
||||||
<th>Net Export Sales Converted to Or Invoiced in AUD</th>
|
<th>Net Export Sales Converted to Or Invoiced in AUD</th>
|
||||||
|
<th>Gross Profit Value Export in AUD</th>
|
||||||
<th>GP% Excl Commissions</th>
|
<th>GP% Excl Commissions</th>
|
||||||
<th>ATO Exchange Rate</th>
|
<th>ATO Exchange Rate</th>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
echo $form->input('invoice_amount');
|
echo $form->input('invoice_amount');
|
||||||
echo $form->input('deferred_gst');
|
echo $form->input('deferred_gst');
|
||||||
echo $form->input('approved');
|
echo $form->input('approved');
|
||||||
|
echo $form->input('paid');
|
||||||
|
echo $form->input('date_paid');
|
||||||
echo $form->input('invoice_type');
|
echo $form->input('invoice_type');
|
||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
@ -19,13 +21,5 @@
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo $html->link(__('List ShipmentInvoices', true), array('action' => 'index'));?></li>
|
<li><?php echo $html->link(__('List ShipmentInvoices', true), array('action' => 'index'));?></li>
|
||||||
<li><?php echo $html->link(__('List Shipments', true), array('controller' => 'shipments', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Shipment', true), array('controller' => 'shipments', '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 Freight Forwarders', true), array('controller' => 'freight_forwarders', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Freight Forwarder', true), array('controller' => 'freight_forwarders', 'action' => 'add')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
echo $form->input('invoice_amount');
|
echo $form->input('invoice_amount');
|
||||||
echo $form->input('deferred_gst');
|
echo $form->input('deferred_gst');
|
||||||
echo $form->input('approved');
|
echo $form->input('approved');
|
||||||
|
echo $form->input('paid');
|
||||||
|
echo $form->input('date_paid');
|
||||||
echo $form->input('invoice_type');
|
echo $form->input('invoice_type');
|
||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
@ -21,13 +23,5 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('ShipmentInvoice.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('ShipmentInvoice.id'))); ?></li>
|
<li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('ShipmentInvoice.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('ShipmentInvoice.id'))); ?></li>
|
||||||
<li><?php echo $html->link(__('List ShipmentInvoices', true), array('action' => 'index'));?></li>
|
<li><?php echo $html->link(__('List ShipmentInvoices', true), array('action' => 'index'));?></li>
|
||||||
<li><?php echo $html->link(__('List Shipments', true), array('controller' => 'shipments', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Shipment', true), array('controller' => 'shipments', '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 Freight Forwarders', true), array('controller' => 'freight_forwarders', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Freight Forwarder', true), array('controller' => 'freight_forwarders', 'action' => 'add')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ echo $paginator->counter(array(
|
||||||
<th><?php echo $paginator->sort('invoice_amount');?></th>
|
<th><?php echo $paginator->sort('invoice_amount');?></th>
|
||||||
<th><?php echo $paginator->sort('deferred_gst');?></th>
|
<th><?php echo $paginator->sort('deferred_gst');?></th>
|
||||||
<th><?php echo $paginator->sort('approved');?></th>
|
<th><?php echo $paginator->sort('approved');?></th>
|
||||||
|
<th><?php echo $paginator->sort('paid');?></th>
|
||||||
|
<th><?php echo $paginator->sort('date_paid');?></th>
|
||||||
<th><?php echo $paginator->sort('invoice_type');?></th>
|
<th><?php echo $paginator->sort('invoice_type');?></th>
|
||||||
<th class="actions"><?php __('Actions');?></th>
|
<th class="actions"><?php __('Actions');?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -33,16 +35,16 @@ foreach ($shipmentInvoices as $shipmentInvoice):
|
||||||
<?php echo $shipmentInvoice['ShipmentInvoice']['id']; ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['id']; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $html->link($shipmentInvoice['Shipment']['id'], array('controller' => 'shipments', 'action' => 'view', $shipmentInvoice['Shipment']['id'])); ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['shipment_id']; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $html->link($shipmentInvoice['Principle']['name'], array('controller' => 'principles', 'action' => 'view', $shipmentInvoice['Principle']['id'])); ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['principle_id']; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $html->link($shipmentInvoice['Currency']['name'], array('controller' => 'currencies', 'action' => 'view', $shipmentInvoice['Currency']['id'])); ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['currency_id']; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $html->link($shipmentInvoice['FreightForwarder']['name'], array('controller' => 'freight_forwarders', 'action' => 'view', $shipmentInvoice['FreightForwarder']['id'])); ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['freight_forwarder_id']; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $shipmentInvoice['ShipmentInvoice']['invoice_number']; ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['invoice_number']; ?>
|
||||||
|
|
@ -56,6 +58,12 @@ foreach ($shipmentInvoices as $shipmentInvoice):
|
||||||
<td>
|
<td>
|
||||||
<?php echo $shipmentInvoice['ShipmentInvoice']['approved']; ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['approved']; ?>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php echo $shipmentInvoice['ShipmentInvoice']['paid']; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php echo $shipmentInvoice['ShipmentInvoice']['date_paid']; ?>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $shipmentInvoice['ShipmentInvoice']['invoice_type']; ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['invoice_type']; ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -76,13 +84,5 @@ foreach ($shipmentInvoices as $shipmentInvoice):
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo $html->link(__('New ShipmentInvoice', true), array('action' => 'add')); ?></li>
|
<li><?php echo $html->link(__('New ShipmentInvoice', true), array('action' => 'add')); ?></li>
|
||||||
<li><?php echo $html->link(__('List Shipments', true), array('controller' => 'shipments', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Shipment', true), array('controller' => 'shipments', '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 Freight Forwarders', true), array('controller' => 'freight_forwarders', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Freight Forwarder', true), array('controller' => 'freight_forwarders', 'action' => 'add')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -6,24 +6,24 @@
|
||||||
<?php echo $shipmentInvoice['ShipmentInvoice']['id']; ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['id']; ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipment'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipment Id'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $html->link($shipmentInvoice['Shipment']['id'], array('controller' => 'shipments', 'action' => 'view', $shipmentInvoice['Shipment']['id'])); ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['shipment_id']; ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle Id'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $html->link($shipmentInvoice['Principle']['name'], array('controller' => 'principles', 'action' => 'view', $shipmentInvoice['Principle']['id'])); ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['principle_id']; ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Currency'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Currency Id'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $html->link($shipmentInvoice['Currency']['name'], array('controller' => 'currencies', 'action' => 'view', $shipmentInvoice['Currency']['id'])); ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['currency_id']; ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Freight Forwarder'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Freight Forwarder Id'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $html->link($shipmentInvoice['FreightForwarder']['name'], array('controller' => 'freight_forwarders', 'action' => 'view', $shipmentInvoice['FreightForwarder']['id'])); ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['freight_forwarder_id']; ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Invoice Number'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Invoice Number'); ?></dt>
|
||||||
|
|
@ -46,6 +46,16 @@
|
||||||
<?php echo $shipmentInvoice['ShipmentInvoice']['approved']; ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['approved']; ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Paid'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php echo $shipmentInvoice['ShipmentInvoice']['paid']; ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Date Paid'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php echo $shipmentInvoice['ShipmentInvoice']['date_paid']; ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Invoice Type'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Invoice Type'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $shipmentInvoice['ShipmentInvoice']['invoice_type']; ?>
|
<?php echo $shipmentInvoice['ShipmentInvoice']['invoice_type']; ?>
|
||||||
|
|
@ -59,13 +69,5 @@
|
||||||
<li><?php echo $html->link(__('Delete ShipmentInvoice', true), array('action' => 'delete', $shipmentInvoice['ShipmentInvoice']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $shipmentInvoice['ShipmentInvoice']['id'])); ?> </li>
|
<li><?php echo $html->link(__('Delete ShipmentInvoice', true), array('action' => 'delete', $shipmentInvoice['ShipmentInvoice']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $shipmentInvoice['ShipmentInvoice']['id'])); ?> </li>
|
||||||
<li><?php echo $html->link(__('List ShipmentInvoices', true), array('action' => 'index')); ?> </li>
|
<li><?php echo $html->link(__('List ShipmentInvoices', true), array('action' => 'index')); ?> </li>
|
||||||
<li><?php echo $html->link(__('New ShipmentInvoice', true), array('action' => 'add')); ?> </li>
|
<li><?php echo $html->link(__('New ShipmentInvoice', true), array('action' => 'add')); ?> </li>
|
||||||
<li><?php echo $html->link(__('List Shipments', true), array('controller' => 'shipments', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Shipment', true), array('controller' => 'shipments', '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 Freight Forwarders', true), array('controller' => 'freight_forwarders', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Freight Forwarder', true), array('controller' => 'freight_forwarders', 'action' => 'add')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
|
||||||
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
<?=$javascript->link('add_edit_shipment');?>
|
<?=$javascript->link('add_edit_shipment');?>
|
||||||
<?=$this->element('add_shipment');?>
|
<?=$this->element('add_edit_shipment', array('invoiceType'=>$invoiceType));?>
|
||||||
|
|
@ -1,133 +1,5 @@
|
||||||
<?=$javascript->link('add_edit_shipment');?>
|
<?=$javascript->link('add_edit_shipment');?>
|
||||||
|
|
||||||
<?php echo $form->create('Shipment', array('default'=>false));?>
|
<?=$this->element('add_edit_shipment', array('invoiceType'=>$invoiceType));?>
|
||||||
<?php
|
|
||||||
echo $form->input('user_id', array('type'=>'hidden', 'value'=>$currentuser['User']['id']));
|
|
||||||
echo $form->input('type', array('options'=>$shipmentType, 'id'=>'shipmentType'));
|
|
||||||
echo $form->input('id', array('type'=>'hidden'));
|
|
||||||
?>
|
|
||||||
<div id="importFields" class="hiddenDefault">
|
|
||||||
<?
|
|
||||||
echo $form->input('date_arrived_display', array('label'=>'Date Arrived', 'id'=>'date_arrived_display', 'value'=>$this->element('isEmptyDate', array('date'=>$this->data['Shipment']['date_arrived']))));
|
|
||||||
echo $form->input('date_arrived', array('type'=>'hidden', 'id'=>'date_arrived'));
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="dateDispatched" class="hiddenDefault">
|
|
||||||
<?
|
|
||||||
echo $form->input('date_dispatched_display', array('label'=>'Date Dispatched', 'id'=>'date_dispatched_display', 'value'=>$this->element('isEmptyDate', array('date'=>$this->data['Shipment']['date_dispatched']))));
|
|
||||||
|
|
||||||
echo $form->input('date_dispatched', array('type'=>'hidden', 'id'=>'date_dispatched'));
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="principle" class="hiddenDefault">
|
|
||||||
<? echo $form->input('Principle', array('name'=>'PrincipleSelect', 'type'=>'select', 'multiple'=>false)); ?>
|
|
||||||
<button id="addPrinciple">Add Principle</button>
|
|
||||||
<ul id="principlesList" class="habtmList">
|
|
||||||
<?php foreach($this->data['Principle'] as $principle):?>
|
|
||||||
<li id="PrincipleID_<?=$principle['id']?>">
|
|
||||||
<button class="removeFromList">X</button>
|
|
||||||
<?=$principle['name'];?>
|
|
||||||
<input type="hidden" name="data[Principle][Principle][]" value="<?=$principle['id']?>">
|
|
||||||
</li>
|
|
||||||
<?php endforeach?>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="purchaseOrder" class="hiddenDefault">
|
|
||||||
<?
|
|
||||||
echo $form->input('purchase_order', array('id'=>'purchase_order_autocomplete'));?>
|
|
||||||
|
|
||||||
<ul id="purchaseOrdersList" class="habtmList">
|
|
||||||
<?php foreach($this->data['PurchaseOrder'] as $po):?>
|
|
||||||
<li id="PurchaseOrderID_<?=$po['id']?>">
|
|
||||||
<button class="removeFromList">X</button>
|
|
||||||
<?=$po['title'];?>
|
|
||||||
<input type="hidden" name="data[PurchaseOrder][PurchaseOrder][]" value="<?=$po['id']?>">
|
|
||||||
</li>
|
|
||||||
<?php endforeach?>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="job" class="hiddenDefault">
|
|
||||||
<?
|
|
||||||
echo $form->input('job', array('id'=>'job_autocomplete'));
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<ul id="jobsList" class="habtmList">
|
|
||||||
<?php foreach($this->data['Job'] as $job):?>
|
|
||||||
<li id="JobID_<?=$job['id']?>">
|
|
||||||
<button class="removeFromList">X</button>
|
|
||||||
<?=$job['title'];?>
|
|
||||||
<input type="hidden" name="data[Job][Job][]" value="<?=$job['id']?>">
|
|
||||||
</li>
|
|
||||||
<?php endforeach?>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="customer" class="hiddenDefault">
|
|
||||||
<?=$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>
|
|
||||||
|
|
||||||
<div id="addressSpan" class="hiddenDefault">
|
|
||||||
<span>Shipping Address:</span>
|
|
||||||
</div>
|
|
||||||
<div id="address" class="hiddenDefault">
|
|
||||||
<?=$form->input('address_id', array('type'=>'hidden', 'id'=>'address_id', 'value'=>$this->data['Shipment']['address_id']));?>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="freight_forwarder" class="hiddenDefault">
|
|
||||||
<?=$form->input('freight_forwarder_id');?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="airway_bill" class="hiddenDefault">
|
|
||||||
<?=$form->input('airway_bill');?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="boxes" class="hiddenDefault">
|
|
||||||
<button id="addBox">Add Box</button>
|
|
||||||
|
|
||||||
<?php $boxNo = 0;?>
|
|
||||||
<?php foreach($this->data['Box'] as $box):?>
|
|
||||||
<div id="" class="boxForm">
|
|
||||||
<button class="removeBox">X</button>
|
|
||||||
<?=$form->input("Box.{$boxNo}.id", array('type'=>'hidden'));?>
|
|
||||||
<?=$form->input("Box.{$boxNo}.shipment_id", array('type'=>'hidden', 'value'=>$this->data['Shipment']['id']));?>
|
|
||||||
<?=$form->input("Box.{$boxNo}.length", array('label'=>'Length (cm)', 'div'=>'length'));?>
|
|
||||||
<?=$form->input("Box.{$boxNo}.width", array('label'=>'Width (cm)', 'div'=>'width'));?>
|
|
||||||
<?=$form->input("Box.{$boxNo}.height", array('label'=>'Height (cm)', 'div'=>'height'));?>
|
|
||||||
<?=$form->input("Box.{$boxNo}.weight", array('label'=>'Weight (kg)', 'div'=>'weight'));?>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
$boxNo++;
|
|
||||||
endforeach;?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="comments" class="hiddenDefault">
|
|
||||||
<?=$form->input('comments');?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?php echo $form->end();?>
|
|
||||||
|
|
||||||
<div id="boxFactory" class="hiddenDefault">
|
|
||||||
<?=$form->input('length', array('label'=>'Length (cm)', 'div'=>'length'));?>
|
|
||||||
<?=$form->input('width', array('label'=>'Width (cm)', 'div'=>'width'));?>
|
|
||||||
<?=$form->input('height', array('label'=>'Height (cm)', 'div'=>'height'));?>
|
|
||||||
<?=$form->input('weight', array('label'=>'Weight (kg)', 'div'=>'weight'));?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php debug($this->data); ?>
|
<?php debug($this->data); ?>
|
||||||
|
|
@ -15,7 +15,8 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="scrollHorizontal">
|
<div class="scrollHorizontal">
|
||||||
<?=$this->element('shipment_index_'.$type);?>
|
<? //$this->element('shipment_index_'.$type);?>
|
||||||
|
<?=$this->element('shipment_index_all');?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1183,45 +1183,6 @@ label span#exchangeConversion {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
form.cmxform {
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
|
|
||||||
form.cmxform input {
|
|
||||||
width: auto;
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
form.cmxform fieldset ol {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
form.cmxform fieldset li {
|
|
||||||
list-style: none;
|
|
||||||
padding: 5px;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
form.cmxform fieldset fieldset {
|
|
||||||
border: none;
|
|
||||||
margin: 3px 0 0;
|
|
||||||
}
|
|
||||||
form.cmxform fieldset fieldset legend {
|
|
||||||
padding: 0 0 5px;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
form.cmxform fieldset fieldset label {
|
|
||||||
display: block;
|
|
||||||
|
|
||||||
}
|
|
||||||
form.cmxform em {
|
|
||||||
font-weight: bold;
|
|
||||||
font-style: normal;
|
|
||||||
color: #f00;
|
|
||||||
}
|
|
||||||
|
|
||||||
form.cmxform fieldset fieldset label {
|
|
||||||
margin-left: 123px; /* Width plus 3 (html space) */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#sortable { list-style-type: none; margin: 0; padding: 0; }
|
#sortable { list-style-type: none; margin: 0; padding: 0; }
|
||||||
|
|
@ -1377,7 +1338,7 @@ select.job_status {
|
||||||
|
|
||||||
|
|
||||||
.scrollHorizontal {
|
.scrollHorizontal {
|
||||||
height: 800px;
|
height: 500px;
|
||||||
overflow:scroll;
|
overflow:scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1477,18 +1438,19 @@ table.shipments {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.boxForm label {
|
|
||||||
float: left;
|
|
||||||
margin-right: 1em;
|
|
||||||
text-align: right;
|
|
||||||
width: 8em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.boxForm div {
|
.boxForm div {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.invForm {
|
||||||
|
border: 1px solid;
|
||||||
|
width: 15em;
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
span.totalWeight {
|
span.totalWeight {
|
||||||
|
|
||||||
font-weight: bolder;
|
font-weight: bolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
var addedBoxes = $(".boxForm").length;
|
var addedBoxes = $(".boxForm").length;
|
||||||
|
var addedInvoices = $('.invForm').length;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('button').button();
|
$('button').button();
|
||||||
displayReleventFields();
|
displayReleventFields();
|
||||||
|
|
@ -32,8 +35,33 @@ $(function() {
|
||||||
$(this).parent().remove();
|
$(this).parent().remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Add a new Freight Forwarder.
|
||||||
|
$('.addFreightForwarder').live('click', function() {
|
||||||
|
$('#newFreightForwarderDiv').show();
|
||||||
|
$(this).hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
//Cancel adding a new Freight Forwarder.
|
||||||
|
$('.cancelNewFF').live('click', function() {
|
||||||
|
$('#newFreightForwarderDiv').hide();
|
||||||
|
$('.addFreightForwarder').show();
|
||||||
|
});
|
||||||
|
|
||||||
|
//Save the new Freight Forwarder. **TODO : Handle errors **.
|
||||||
|
$('.saveNewFF').live('click', function() {
|
||||||
|
|
||||||
|
$.post('/freight_forwarders/ajax_add', $('#newFreightForwarder'), function(data) {
|
||||||
|
if(data == 'SUCCESS') {
|
||||||
|
$.get('/freight_forwarders/build_options', function(newOptions) {
|
||||||
|
$('#ShipmentFreightForwarderId').html(newOptions);
|
||||||
|
$('#newFreightForwarderDiv').hide();
|
||||||
|
$('.addFreightForwarder').show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
//Add a(nother) Principle to this Shipment
|
||||||
$('#addPrinciple').button().click(function() {
|
$('#addPrinciple').button().click(function() {
|
||||||
|
|
||||||
var principleID = getSelectedID('#PrinciplePrinciple');
|
var principleID = getSelectedID('#PrinciplePrinciple');
|
||||||
|
|
@ -106,6 +134,17 @@ $(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("#addInvoice").button().click(function() {
|
||||||
|
addInvoice(addedInvoices);
|
||||||
|
addedInvoices++;
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".removeInvoice").live('click',function() {
|
||||||
|
$(this).parent().remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(".selectAddress").live('click', function() {
|
$(".selectAddress").live('click', function() {
|
||||||
var ID = $(this).attr('id');
|
var ID = $(this).attr('id');
|
||||||
$("#address_id").val(ID);
|
$("#address_id").val(ID);
|
||||||
|
|
@ -147,25 +186,29 @@ $(function() {
|
||||||
|
|
||||||
switch(shipmentTypeID) {
|
switch(shipmentTypeID) {
|
||||||
case 1: //Import
|
case 1: //Import
|
||||||
$("#importFields, #principle, #purchaseOrder, #freight_forwarder, #airway_bill, #boxes").show();
|
$("#importFields, #principle, #purchaseOrder").show();
|
||||||
|
showCommonFields();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: //Direct
|
case 2: //Direct
|
||||||
$("#purchaseOrder, #job,#principle, #dateDispatched, #customer, #address, #addressSpan, #freight_forwarder, #airway_bill, #boxes").show();
|
$("#purchaseOrder, #job,#principle, #dateDispatched, #customer, #address, #addressSpan").show();
|
||||||
|
showCommonFields();
|
||||||
break;
|
break;
|
||||||
case 3: //Export
|
case 3: //Export
|
||||||
$("#job, #dateDispatched, #customer, #address, #addressSpan, #freight_forwarder, #airway_bill, #boxes").show();
|
$("#job, #dateDispatched, #customer, #address, #addressSpan").show();
|
||||||
|
showCommonFields();
|
||||||
break;
|
break;
|
||||||
case 4: //Local
|
case 4: //Local
|
||||||
$("#job, #dateDispatched, #customer, #address, #addressSpan, #freight_forwarder, #airway_bill, #boxes").show();
|
$("#job, #dateDispatched, #customer, #address, #addressSpan").show();
|
||||||
|
showCommonFields();
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//Show the fields in the shipment form that are available
|
||||||
|
//for all 4 cases
|
||||||
|
function showCommonFields() {
|
||||||
|
$("#airway_bill, #boxes, #invoices, #freight_forwarder, #comments").show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function addBox(addedBoxes) {
|
function addBox(addedBoxes) {
|
||||||
|
|
@ -176,39 +219,24 @@ $(function() {
|
||||||
|
|
||||||
var boxNo = addedBoxes;
|
var boxNo = addedBoxes;
|
||||||
|
|
||||||
newBoxForm.attr('id','');
|
newBoxForm.removeAttr('id');
|
||||||
newBoxForm.addClass('boxForm');
|
newBoxForm.addClass('boxForm');
|
||||||
newBoxForm.show();
|
newBoxForm.show();
|
||||||
|
|
||||||
//Set the appropriate naming for the fields so cake can work its magic.
|
|
||||||
//Should refactor into a function.
|
|
||||||
var div = newBoxForm.find('.length');
|
|
||||||
var ID = getCakeID(model,boxNo,'length');
|
|
||||||
var name = getCakeName(model, boxNo, 'length');
|
|
||||||
div.children('label').attr('for', ID);
|
|
||||||
div.children('input').attr('id', ID).attr('name', name);
|
|
||||||
|
|
||||||
div = newBoxForm.find('.width');
|
|
||||||
ID = getCakeID(model,boxNo,'width');
|
|
||||||
name = getCakeName(model, boxNo, 'width');
|
|
||||||
div.children('label').attr('for', ID);
|
|
||||||
div.children('input').attr('id', ID).attr('name', name);
|
|
||||||
|
|
||||||
div = newBoxForm.find('.height');
|
|
||||||
ID = getCakeID(model,boxNo,'height');
|
|
||||||
name = getCakeName(model, boxNo, 'height');
|
|
||||||
div.children('label').attr('for', ID);
|
|
||||||
div.children('input').attr('id', ID).attr('name', name);
|
|
||||||
|
|
||||||
div = newBoxForm.find('.weight');
|
|
||||||
ID = getCakeID(model,boxNo,'weight');
|
|
||||||
name = getCakeName(model, boxNo, 'weight');
|
|
||||||
div.children('label').attr('for', ID);
|
|
||||||
div.children('input').attr('id', ID).attr('name', name);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var boxFields = ['length', 'width', 'height', 'weight'];
|
||||||
|
|
||||||
|
var div;
|
||||||
|
var ID;
|
||||||
|
var name;
|
||||||
|
|
||||||
|
$.each(boxFields, function(index, field) {
|
||||||
|
div = newBoxForm.find('.'+field);
|
||||||
|
ID = getCakeID(model,boxNo,field);
|
||||||
|
name = getCakeName(model, boxNo, field);
|
||||||
|
div.children('label').attr('for', ID);
|
||||||
|
div.children('input').attr('id', ID).attr('name', name);
|
||||||
|
});
|
||||||
|
|
||||||
var closeButton = $('<button>X</button>');
|
var closeButton = $('<button>X</button>');
|
||||||
closeButton.addClass('removeBox');
|
closeButton.addClass('removeBox');
|
||||||
|
|
@ -220,6 +248,41 @@ $(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function addInvoice(addedInvoices) {
|
||||||
|
var model = 'ShipmentInvoice';
|
||||||
|
var invoiceNo = addedInvoices;
|
||||||
|
|
||||||
|
var newInvoiceForm = $('#invoiceFactory').clone();
|
||||||
|
newInvoiceForm.removeAttr('id');
|
||||||
|
newInvoiceForm.addClass('invForm');
|
||||||
|
newInvoiceForm.show();
|
||||||
|
|
||||||
|
var invFields = ['currency_id', 'freight_forwarder_id', 'invoice_number',
|
||||||
|
'invoice_amount','gst_amount','deferred_gst', 'deferred_gst_amount','approved', 'paid', 'date_paid','invoice_type'];
|
||||||
|
|
||||||
|
var div;
|
||||||
|
var ID;
|
||||||
|
|
||||||
|
$.each(invFields, function(index,field) {
|
||||||
|
div = newInvoiceForm.find('.inv_'+field);
|
||||||
|
ID = getCakeID(model,invoiceNo, field);
|
||||||
|
name = getCakeName(model, invoiceNo, field);
|
||||||
|
div.children('label').attr('for', ID);
|
||||||
|
div.children('input').attr('id', ID).attr('name', name);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
var closeButton = $('<button>X</button>');
|
||||||
|
closeButton.addClass('removeBox');
|
||||||
|
closeButton.button();
|
||||||
|
|
||||||
|
newInvoiceForm.prepend(closeButton);
|
||||||
|
$("#invoices").append(newInvoiceForm);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function getCakeID(model, count, field) {
|
function getCakeID(model, count, field) {
|
||||||
return model+count+capitalizeFirstLetter(field);
|
return model+count+capitalizeFirstLetter(field);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue