[ADD] support for generic alternative content in right-hand side

dd.alternatives triggers "widget", each (dt, dd) is an alternative with
dt being the alternative (and radio button) label and dd being the
actual content to display on selection.
This commit is contained in:
Xavier Morel 2015-04-16 11:57:02 +02:00
parent eb20f603b5
commit 15c51c9845
3 changed files with 165 additions and 32 deletions

View File

@ -153,3 +153,17 @@ blockquote.highlights {
margin-bottom: 0;
text-align: center;
}
/*
lists of alternatives
*/
.alternatives-controls label {
display: block;
}
dl.alternatives > dt,
dl.alternatives > dd {
display: none;
}
dl.alternatives > dd {
margin-left: 0;
}

View File

@ -1,5 +1,52 @@
(function () {
document.addEventListener('DOMContentLoaded', function () {
alternatives()
checks_handling();
});
/** alternatives display:
* - prepend control for each <dt>
* - radio input with link to following dd
* - label is <dt> content
* - hide all first-level dt and dd (CSS)
* - on change
* - hide all dds
* - show dd corresponding to the selected radio
* - automatically select first control on startup
*/
function alternatives() {
$('dl.alternatives').each(function (index) {
var $list = $(this),
$contents = $list.children('dd');
var $controls = $('<div class="alternatives-controls">').append(
$list.children('dt').map(function () {
var label = document.createElement('label'),
input = document.createElement('input');
input.setAttribute('type', 'radio');
input.setAttribute('name', 'alternatives-' + index);
var sibling = this;
while ((sibling = sibling.nextSibling) && sibling.nodeType !== 1);
input.content = sibling;
label.appendChild(input);
label.appendChild(document.createTextNode(' '));
label.appendChild(document.createTextNode(this.textContent));
return label;
}))
.insertBefore($list)
.on('change', 'input', function (e) {
// change event triggers only on newly selected input, not
// on the one being deselected
$contents.css('display', '');
var content = e.target.content;
content && (content.style.display = 'block');
})
.find('input:first').click();
});
}
function checks_handling() {
var $section = $('.checks-handling');
if (!$section.length) { return; }
@ -9,7 +56,7 @@
while (this.firstChild) {
this.removeChild(this.firstChild)
}
$('<label style="display: block;">')
.append('<input type="radio" name="checks-handling">')
.append(' ')
@ -28,5 +75,6 @@
}).eq(idx).prop('checked', true);
$ul.nextAll('div').hide().eq(idx).show();
}
});
}
})();

View File

@ -17,13 +17,30 @@ Operations
Stock moves represent the transit of goods and materials between inventory
locations.
* Manufacturing Order
* Drop-shipping
* Picking ➔ Packing ➔ Shipping
* Inter-Warehouse transfert
* Loss of product
* Inventory
* Reception
.. rst-class:: alternatives force-right
Manufacturing Order
Consume:
| 2 Wheels: Warehouse → Manufacturing
| 1 Bike Frame: Warehouse → Manufacturing
Produce:
1 Bicycle: Manufacturing → Warehouse
Configuration:
| Warehouse: the location the Manufacturing Order is initiated
| Manufacturing: on the product form, field “Manufacturing Location”
Drop-shipping
stuff 1
Picking ➔ Packing ➔ Shipping
stuff 2
Inter-Warehouse transfert
stuff 3
Loss of product
stuff 4
Inventory
stuff 5
Reception
stuff 6
Analysis
========
@ -41,17 +58,33 @@ For each inventory location, multiple data points can be analysed:
* value of products delivered to clients over a period
* value of products in transit between locations
Procurements & Pull Rules
=========================
Procurements & Procurement Rules
================================
A procurement is a request for a specific quantity of products to a specific
location. They can be created manually or automatically triggered by:
* sale orders
* minimum stock rules
* rules
.. rst-class:: alternatives force-right
*Pull rules* describe how to fulfill procurements on specific locations:
Sale order
Effect
A procurement is created at the customer location for every product
ordered by the customer (you have to deliver the customer)
Configuration
Procurement Location: on the customer, field “Customer Location” (property)
Minimum Stock Rule
Effect
todo
Configuration
todo
Rules
Effect
todo
Configuration
todo
*Procurement rules* describe how to fulfill procurements on specific
locations:
* where the product should come from (source location)
* whether the procurement is :abbr:`MTO (Made To Order)` or :abbr:`MTS (Made
@ -64,30 +97,68 @@ location. They can be created manually or automatically triggered by:
Routes
======
At each step or a procurement's fulfillment, multiple rules may be
available. *Routes* define which rules should be used based on the environment
(product, sales orders, warehouse, …). To fulfill a procurement, the system
will search for routes in the following order:
Procurement rules are grouped in routes. Routes define paths the product must
follow. Routes may be applicable or not, depending on the products, sales
order lines, warehouse,...
1. sale order line routes
2. product routes
3. product category routes
4. warehouse routes
To fulfill a procurement, the system will search for rules belonging to routes
that are defined in (by order of priority):
.. rst-class:: alternatives force-right
Warehouses
Warehouse Route Example:
Pick → Pack → Ship
Picking List:
Pick Zone → Pack Zone
Pack List:
Pack Zone → Gate A
Delivery Order:
Gate A → Customer
Routes that describe how you organize your warehouse should be defined on the warehouse.
A Product
Product Route Example:
Supplier → Quality Control → Inventory
Product Category
Product Category Route Example:
Supplier → Cross-Docks → Pack Zone
Sale Order Line
Sale Order Line Example: Drop-shipping
Supplier → Customer
Push Rules
==========
Push rules are triggered when a product enters a specific location, and allows
chaining locations. Push rules can also be configured and filtered using
routes.
Some example:
* quality control
* transit warehouse 1
Push rule are trigered when products arrive at a specific location and allows
to automatically move them to another location. Push rules applications also
depends on applicable routes.
.. warning:: push rules and pull rules are *not* symmetrical, pull rules are
triggered by procurement requests whereas push rules are
triggered by stock moves
.. rst-class:: alternatives force-right
Quality Control
* Product lands in Arrival Zone
* Push 1: Arrival Zone → Quality Control
* Push 2: Quality Control → Inventry
Transit Warehouse 1
* Product lands in ?
Procurement Groups
==================
Routes and rules defines the inventory moves. On every rule, the document type
is provided:
* Picking
* Packing
* Delivery Order
* Purchase Order
* ...
Moves are grouped within the same document type if their procurement group and
locations are the same.
A sale order creates a procurement group so that pickings and delivery orders
of the same order are grouped. But you can define specific groups on
reordering rules too. (e.g. to group purchases of specific products together)