[ADD] highlighted table to double entry document

This commit is contained in:
Xavier Morel 2015-04-16 13:19:26 +02:00
parent 15c51c9845
commit 6c250deca8
3 changed files with 92 additions and 13 deletions

View File

@ -13,8 +13,9 @@
background-color: hsl(219, 67%, 94%);
}
#chart-controls label:hover,
#entries-control label:hover {
label:hover,
label:hover,
.highlighter-list li:hover {
background-color: hsl(0, 0%, 94%);
cursor: pointer;
}
@ -86,15 +87,19 @@
}
@media (min-width: 992px) {
.accounts-table {
.accounts-table, .force-right .highlighter-target {
font-size: 90%;
color: #888 !important;
}
.accounts-table .related {
.force-right .highlighter-target th {
font-weight: normal;
font-size: 110%;
}
.accounts-table .related, .force-right .highlighter-target .related {
background-color: transparent !important;
color: #eee !important;
}
.accounts-table .secondary {
.accounts-table .secondary, .force-right .highlighter-target .secondary {
background-color: transparent !important;
color: #aaa !important;
}

View File

@ -1,9 +1,27 @@
(function () {
document.addEventListener('DOMContentLoaded', function () {
alternatives()
alternatives();
highlight();
checks_handling();
});
function highlight() {
$('.highlighter-list').each(function () {
var $this = $(this),
$target = $($this.data('target'));
$this.on('mouseout', 'li', function (e) {
$(e.currentTarget).removeClass('secondary');
$target.find('.related').removeClass('related');
}).on('mouseover', 'li', function (e) {
if (!e.currentTarget.contains(e.target)) { return; }
var $li = $(e.currentTarget);
console.log($li, $li.data('highlight'), $target.find($li.data('highlight')));
$li.addClass('secondary');
$target.find($li.data('highlight')).addClass('related');
});
});
}
/** alternatives display:
* - prepend control for each <dt>
* - radio input with link to following dd

View File

@ -50,13 +50,69 @@ products cost).
For each inventory location, multiple data points can be analysed:
* inventory valuation
* value creation (difference between the value of manufactured products and
the cost of raw materials used during manufacturing)
* value of lost/stolen products
* value of scrapped products
* value of products delivered to clients over a period
* value of products in transit between locations
.. raw:: html
<ul class="highlighter-list" data-target=".analysis-table">
<li data-highlight=".analysis-valuation">inventory valuation</li>
<li data-highlight=".analysis-creation">
value creation (difference between the value of manufactured products
and the cost of raw materials used during manufacturing) (negative)
</li>
<li data-highlight=".analysis-lost">value of lost/stolen products</li>
<li data-highlight=".analysis-scrapped">value of scrapped products</li>
<li data-highlight=".analysis-delivered">value of products delivered to clients over a period</li>
<li data-highlight=".analysis-transit">value of products in transit between locations</li>
</ul>
.. h:div:: force-right analysis-table
.. raw:: html
<table class="table table-condensed highlighter-target">
<thead>
<tr>
<th>Location</th> <th class="text-right">Value</th>
</tr>
</thead>
<tbody>
<tr class="analysis-valuation">
<th>Physical Locations</th> <td class="text-right">$1,000</td>
</tr>
<tr>
<th>&#8193;Warehouse 1</th> <td class="text-right">$600</td>
</tr>
<tr>
<th>&#8193;Warehouse 2</th> <td class="text-right">$400</td>
</tr>
<tr>
<th>Partner Locations</th> <td class="text-right">- $1,500</td>
</tr>
<tr class="analysis-delivered">
<th>&#8193;Customers</th> <td class="text-right">$2,000</td>
</tr>
<tr>
<th>&#8193;Suppliers</th> <td class="text-right">- $3,500</td>
</tr>
<tr>
<th>Virtual Locations</th> <td class="text-right">$500</td>
</tr>
<tr class="analysis-transit">
<th>&#8193;Transit Location</th> <td class="text-right">$600</td>
</tr>
<tr>
<th>&#8193;Initial Inventory</th> <td class="text-right">$0</td>
</tr>
<tr class="analysis-lost">
<th>&#8193;Inventory Loss</th> <td class="text-right">$350</td>
</tr>
<tr class="analysis-scrapped">
<th>&#8193;Scraped</th> <td class="text-right">$550</td>
</tr>
<tr class="analysis-creation">
<th>&#8193;Manufacturing</th> <td class="text-right">- $1,000</td>
</tr>
</tbody>
</table>
Procurements & Procurement Rules
================================