Shipment register finished. FUCKING FINALLY
This commit is contained in:
parent
1eb297b035
commit
490ba20cce
|
|
@ -54,10 +54,10 @@ class ShipmentsController extends AppController {
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
$this->set('shipments', $this->paginate($conditions));
|
$this->set('shipments', $this->paginate($conditions));
|
||||||
$this->set('type', $type);
|
$this->set('type', $type);
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ class ShipmentsController extends AppController {
|
||||||
$shipmentType = $this->typeOptions(false);
|
$shipmentType = $this->typeOptions(false);
|
||||||
$shipmentTypeShort = $this->typeOptions(true);
|
$shipmentTypeShort = $this->typeOptions(true);
|
||||||
$currencies = $this->Shipment->ShipmentInvoice->Currency->find('list');
|
$currencies = $this->Shipment->ShipmentInvoice->Currency->find('list');
|
||||||
|
|
||||||
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort', 'currencies'));
|
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort', 'currencies'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -103,7 +103,12 @@ class ShipmentsController extends AppController {
|
||||||
$shipmentType = $this->typeOptions(false);
|
$shipmentType = $this->typeOptions(false);
|
||||||
$shipmentTypeShort = $this->typeOptions(true);
|
$shipmentTypeShort = $this->typeOptions(true);
|
||||||
$currencies = $this->Shipment->ShipmentInvoice->Currency->find('list');
|
$currencies = $this->Shipment->ShipmentInvoice->Currency->find('list');
|
||||||
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort', 'currencies'));
|
|
||||||
|
$invoiceType = $this->invoiceTypeOptions();
|
||||||
|
$this->set('yesNo', array(0=>'No', 1=>'Yes'));
|
||||||
|
|
||||||
|
$this->set(compact('principles', 'freightForwarders', 'shipmentType', 'shipmentTypeShort', 'currencies','invoiceType', 'yesNo'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,17 +137,19 @@ echo $form->input('id', array('type'=>'hidden'));
|
||||||
<?
|
<?
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.id", array('type'=>'hidden'));
|
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}.shipment_id", array('type'=>'hidden', 'value'=>$this->data['Shipment']['id']));
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.currency_id");
|
echo $form->input("ShipmentInvoice.{$invNo}.invoice_type", array('type'=>'select','label'=>'Invoice Type', 'div'=>'inv_invoice_type', 'options'=>$invoiceType));
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.freight_forwarder_id");
|
echo $form->input("ShipmentInvoice.{$invNo}.currency_id",array('label'=>'Currency', 'div'=>'inv_currency_id', 'options'=>$currencies, 'empty'=>'Choose Invoice Currency'));
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.invoice_number");
|
echo $form->input("ShipmentInvoice.{$invNo}.freight_forwarder_id", array('label'=>'Freight Forwarder', 'div'=>'inv_freight_forwarder_id', 'options'=>$freightForwarders, 'empty'=>'Select Freight Forwarder'));
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.invoice_amount");
|
echo $form->input("ShipmentInvoice.{$invNo}.invoice_number", array('label'=>'Invoice Number', 'div'=>'inv_invoice_number'));
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.gst_amount");
|
echo $form->input("ShipmentInvoice.{$invNo}.invoice_amount", array('label'=>'Invoice Amount', 'div'=>'inv_invoice_amount'));
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.deferred_gst");
|
echo $form->input("ShipmentInvoice.{$invNo}.gst_amount", array('label'=>'GST Amount', 'div'=>'inv_gst_amount'));
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.approved");
|
echo $form->input("ShipmentInvoice.{$invNo}.deferred_gst", array('label'=>'Deferred GST?', 'div'=>'inv_deferred_gst', 'options'=>$yesNo));
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.paid");
|
echo $form->input("ShipmentInvoice.{$invNo}.deferred_gst_amount", array('label'=>'Deferred GST Amount', 'div'=>'inv_deferred_gst_amount'));
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.date_paid");
|
echo $form->input("ShipmentInvoice.{$invNo}.approved", array('label'=>'Approved', 'div'=>'inv_approved', 'options'=>$yesNo));
|
||||||
echo $form->input("ShipmentInvoice.{$invNo}.invoice_type");
|
echo $form->input("ShipmentInvoice.{$invNo}.paid", array('label'=>'Paid', 'div'=>'inv_paid', 'options'=>$yesNo));
|
||||||
|
echo $form->input("ShipmentInvoice.{$invNo}.date_paid", array('label'=>'Date Paid', 'div'=>'inv_date_paid', 'class'=>'date_paid', 'type'=>'text'));
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
$invNo++;
|
$invNo++;
|
||||||
|
|
@ -172,15 +174,16 @@ echo $form->input('id', array('type'=>'hidden'));
|
||||||
<div id="invoiceFactory" class="hiddenDefault">
|
<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("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("currency_id",array('label'=>'Currency', 'div'=>'inv_currency_id', 'options'=>$currencies, 'empty'=>'Choose Invoice Currency'));
|
||||||
echo $form->input("freight_forwarder_id", array('label'=>'Freight Forwarder', 'div'=>'inv_freight_forwarder_id', 'options'=>$freightForwarders));
|
echo $form->input("freight_forwarder_id", array('label'=>'Freight Forwarder', 'div'=>'inv_freight_forwarder_id', 'options'=>$freightForwarders, 'empty'=>'Select Freight Forwarder'));
|
||||||
echo $form->input("invoice_number", array('label'=>'Invoice Number', 'div'=>'inv_invoice_number'));
|
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("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("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", 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("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("approved", array('label'=>'Approved', 'div'=>'inv_approved', 'options'=>$yesNo));
|
||||||
echo $form->input("paid", array('label'=>'Paid', 'div'=>'inv_paid'));
|
echo $form->input("paid", array('label'=>'Paid', 'div'=>'inv_paid', 'options'=>$yesNo));
|
||||||
echo $form->input("date_paid", array('label'=>'Date Paid', 'div'=>'inv_date_paid'));
|
echo $form->input("date_paid", array('label'=>'Date Paid', 'div'=>'inv_date_paid', 'class'=>'date_paid', 'type'=>'text'));
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
<?=$javascript->link('add_edit_shipment');?>
|
<?=$javascript->link('add_edit_shipment');?>
|
||||||
<?=$this->element('add_edit_shipment', array('invoiceType'=>$invoiceType));?>
|
<?=$this->element('add_edit_shipment');?>
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?=$javascript->link('add_edit_shipment');?>
|
<?=$javascript->link('add_edit_shipment');?>
|
||||||
|
|
||||||
<?=$this->element('add_edit_shipment', array('invoiceType'=>$invoiceType));?>
|
<?=$this->element('add_edit_shipment');?>
|
||||||
|
|
||||||
<?php debug($this->data); ?>
|
<?php debug($this->data); ?>
|
||||||
|
|
@ -1444,7 +1444,7 @@ table.shipments {
|
||||||
|
|
||||||
.invForm {
|
.invForm {
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
width: 15em;
|
width: 20em;
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,12 @@ $(function() {
|
||||||
altField: '#date_dispatched'
|
altField: '#date_dispatched'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('.date_paid').datepicker({
|
||||||
|
showButtonPanel: true,
|
||||||
|
dateFormat: 'yy-mm-dd'
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the relevent elements depending on this Shipment Type */
|
* Display the relevent elements depending on this Shipment Type */
|
||||||
$("#shipmentType").change(function() {
|
$("#shipmentType").change(function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue