mirror of
https://github.com/brmlab/brmbiolab_sklad.git
synced 2025-06-10 14:13:59 +02:00
Index/Add views for StockUnitType and ItemType, View/Update for Item, Style to apply on all tables, DataTables used on details and indexes
This commit is contained in:
parent
be2b39c5eb
commit
5d4d209549
15 changed files with 322 additions and 313 deletions
89
app/View/Items/view.ctp
Normal file
89
app/View/Items/view.ctp
Normal file
|
@ -0,0 +1,89 @@
|
|||
<table class="dataTable">
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td><?php echo $item['Item']['id']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td><?php echo $item['Item']['name']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Type</td>
|
||||
<td><?php echo $item['ItemType']['name']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Stock Quantity</td>
|
||||
<td><?php echo $item['StockHistory'][0]['amount_in_stock'] . ' ' . $item['StockUnitType']['name']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Placement</td>
|
||||
<td><?php echo $item['StockHistory'][0]['location']; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br class="clear"/>
|
||||
<hr/>
|
||||
<h2>Update Stock Quantity and Placement</h2>
|
||||
<?php
|
||||
echo $this->Form->create('StockHistory');
|
||||
echo $this->Form->hidden('item_id', array('value' => $item['Item']['id']));
|
||||
echo $this->Form->inputs(array(), array('created', 'modified', 'item_id'));
|
||||
echo $this->Form->end(__('Save'));
|
||||
?>
|
||||
<br class="clear"/>
|
||||
<hr/>
|
||||
<h2>Item Stock History</h2>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
var table = $("#item-stock-history").DataTable({
|
||||
paging: false,
|
||||
orderMulti: true,
|
||||
info: false,
|
||||
columns: [
|
||||
{searchable: true},
|
||||
{searchable: true},
|
||||
{searchable: true},
|
||||
{searchable: true},
|
||||
],
|
||||
order: [
|
||||
[3, 'desc']
|
||||
],
|
||||
search: {
|
||||
caseInsensitive: true
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<table id="item-stock-history">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Quantity</td>
|
||||
<td>Placement</td>
|
||||
<td>When</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
foreach ($item['StockHistory'] as $history) {
|
||||
printf(
|
||||
'<tr>
|
||||
<td>%d</td>
|
||||
<td>%d</td>
|
||||
<td>%s</td>
|
||||
<td>%s</td>
|
||||
</tr>',
|
||||
$history['id'],
|
||||
$history['amount_in_stock'],
|
||||
$history['location'],
|
||||
$history['created']
|
||||
);
|
||||
}
|
||||
?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Quantity</td>
|
||||
<td>Placement</td>
|
||||
<td>When</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
Loading…
Add table
Add a link
Reference in a new issue