424 lines
12 KiB
XML
Executable File
424 lines
12 KiB
XML
Executable File
<vn>
|
|
<vn-group>
|
|
<vn-lot-query
|
|
id="lot"
|
|
source="hash"
|
|
on-change="onLotChange"/>
|
|
<vn-lot id="card-lot"/>
|
|
<vn-param lot="hash" name="realm" on-changed="onRealmChange"/>
|
|
<vn-param lot="hash" name="type" on-changed="refreshTitle"/>
|
|
<sql-filter type="AND" id="filter">
|
|
<sql-filter-item type="EQUAL"
|
|
field="tipo_id" target="a"
|
|
param="type"/>
|
|
<sql-filter type="OR">
|
|
<sql-filter-item type="LIKE"
|
|
field="Article" target="a"
|
|
param="search"/>
|
|
<sql-filter-item type="EQUAL"
|
|
field="Id_Article" target="a"
|
|
param="search"/>
|
|
</sql-filter>
|
|
<sql-filter-item type="EQUAL"
|
|
field="Color" target="a"
|
|
param="color"/>
|
|
<sql-filter-item type="EQUAL"
|
|
field="id_origen" target="a"
|
|
param="origin"/>
|
|
<sql-filter-item type="EQUAL"
|
|
field="Categoria" target="a"
|
|
param="category"/>
|
|
<sql-filter-item type="EQUAL"
|
|
field="producer_id" target="a"
|
|
param="producer"/>
|
|
</sql-filter>
|
|
<db-model
|
|
id="items"
|
|
result-index="2"
|
|
lot="lot"
|
|
auto-load="false">
|
|
CREATE TEMPORARY TABLE tmp.bionic_calc
|
|
(INDEX (item_id))
|
|
ENGINE = MEMORY
|
|
SELECT a.Id_Article item_id
|
|
FROM vn2008.Articles a
|
|
JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id
|
|
WHERE #filter;
|
|
CALL bionic_calc ();
|
|
SELECT a.Id_Article item_id, a.description, b.available, b.price,
|
|
b.producer, a.Foto, a.Article, a.Categoria, a.Medida,
|
|
IF(a.Tallos > 1, a.Tallos, NULL) Tallos, c.str color
|
|
FROM tmp.bionic_item b
|
|
JOIN vn2008.Articles a ON a.Id_Article = b.item_id
|
|
LEFT JOIN vn2008.producer p ON p.producer_id = a.producer_id
|
|
LEFT JOIN vn_locale.color_view c ON c.color_id = a.Color
|
|
LEFT JOIN vn_locale.origin_view o ON o.origin_id = a.id_origen
|
|
WHERE b.available > 0
|
|
ORDER BY a.Article, a.Medida
|
|
LIMIT 40;
|
|
</db-model>
|
|
<db-form id="basket" on-ready="onBasketReady">
|
|
<db-model property="model">
|
|
SELECT o.id, o.date_send, ag.description agency, v.code method
|
|
FROM basket o
|
|
JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id
|
|
JOIN vn2008.Vistas v ON v.vista_id = o.delivery_method_id
|
|
</db-model>
|
|
</db-form>
|
|
<db-query id="basket-lines">
|
|
SELECT item_id, warehouse_id, SUM(amount) amount
|
|
FROM basket_item
|
|
GROUP BY warehouse_id
|
|
</db-query>
|
|
<db-form id="card" model="items"/>
|
|
<db-form id="card-extend">
|
|
<db-model
|
|
property="model"
|
|
lot="card-lot"
|
|
on-status-changed-after="onStatusChange">
|
|
SELECT a.description, o.str origin
|
|
FROM vn2008.Articles a
|
|
LEFT JOIN vn_locale.origin_view o ON o.origin_id = a.id_origen
|
|
WHERE a.Id_Article = #item
|
|
</db-model>
|
|
</db-form>
|
|
<db-model
|
|
id="item-lots"
|
|
result-index="1"
|
|
lot="card-lot"
|
|
on-status-changed-after="onStatusChange">
|
|
CALL bionic_from_item (#item);
|
|
SELECT p.warehouse_id, w.name warehouse, p.grouping, p.price, p.rate, l.available
|
|
FROM tmp.bionic_lot l
|
|
JOIN tmp.bionic_price p ON p.warehouse_id = l.warehouse_id
|
|
JOIN vn2008.warehouse w ON w.id = p.warehouse_id
|
|
ORDER BY warehouse_id, grouping;
|
|
</db-model>
|
|
</vn-group>
|
|
<h1 id="title">
|
|
<t>Catalog</t>
|
|
</h1>
|
|
<div id="actions" class="catalog-actions">
|
|
<button class="menu" on-click="onShowMenuClick">
|
|
<img src="image/icon/dark/menu.svg" alt="_Menu"/>
|
|
</button>
|
|
<htk-bar-button
|
|
icon="basket"
|
|
tip="_ShoppingBasket"
|
|
on-click="onBasketClick"/>
|
|
<htk-bar-button
|
|
id="view-button"
|
|
tip="_Switch view"
|
|
on-click="onSwitchViewClick"/>
|
|
<htk-search-entry
|
|
lot="hash"
|
|
name="search"/>
|
|
</div>
|
|
<div id="main" class="catalog">
|
|
<htk-repeater
|
|
id="grid-view"
|
|
empty-message="_Choose filter from right menu"
|
|
form-id="item"
|
|
model="items">
|
|
<custom>
|
|
<div class="card item-box">
|
|
<htk-image
|
|
directory="catalog"
|
|
subdir="200x200"
|
|
lot="item"
|
|
name="Foto"
|
|
full-dir="900x900"/>
|
|
<div class="item-info">
|
|
<htk-button
|
|
lot="item"
|
|
name="id"
|
|
tip="_AddToBasket"
|
|
icon="add"
|
|
on-click="onAddItemClick"
|
|
class="add-button"/>
|
|
<h2>
|
|
<htk-text lot="item" name="Article"/>
|
|
</h2>
|
|
<p class="producer">
|
|
<htk-text lot="item" name="producer"/>
|
|
</p>
|
|
<p>
|
|
<t>Size</t> <htk-text lot="item" name="Medida"/>,
|
|
<t>Category</t> <htk-text lot="item" name="Categoria"/>
|
|
</p>
|
|
<p class="color">
|
|
<t>Color</t> <htk-text lot="item" name="color"/>
|
|
<htk-text lot="item" name="Tallos" format="_, %.0d Units"/>
|
|
</p>
|
|
<div class="aval-price">
|
|
<htk-text lot="item" name="available"/>
|
|
<span class="from">
|
|
<t>from</t>
|
|
</span>
|
|
<span class="price">
|
|
<htk-text lot="item" name="price" format="%.2d€"/>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</custom>
|
|
</htk-repeater>
|
|
</div>
|
|
<div id="right-panel" class="right-panel" on-click="onRightPanelClick">
|
|
<div class="basket-info">
|
|
<p>
|
|
<htk-text lot="basket" name="date_send" format="%D"/>
|
|
</p>
|
|
<p>
|
|
<span id="method"/>
|
|
<htk-text lot="basket" name="agency"/>
|
|
</p>
|
|
<button class="thin" on-click="onConfigureClick">
|
|
<t>Change</t>
|
|
</button>
|
|
</div>
|
|
<div class="filter">
|
|
<div class="categories">
|
|
<div class="realms">
|
|
<htk-repeater
|
|
renderer="realmRenderer"
|
|
class="realms-box">
|
|
<db-model
|
|
id="realms"
|
|
property="model"
|
|
on-status-changed="refreshTitleColor">
|
|
SELECT r.id, l.str name, r.color
|
|
FROM vn2008.reinos r
|
|
LEFT JOIN vn_locale.realm_view l ON l.realm_id = r.id
|
|
WHERE r.display != FALSE
|
|
ORDER BY name
|
|
</db-model>
|
|
<custom>
|
|
<a id="link" class="clickable">
|
|
<img id="image"/>
|
|
</a>
|
|
</custom>
|
|
</htk-repeater>
|
|
<div class="clear"/>
|
|
</div>
|
|
</div>
|
|
<div id="realm-msg" class="realm-msg">
|
|
<h1><t>Choose a realm</t></h1>
|
|
</div>
|
|
<div id="filters" class="filters">
|
|
<h2><t>Filter by</t></h2>
|
|
<vn-filter
|
|
lot="hash"
|
|
name="type"
|
|
placeholder="_Family">
|
|
<db-model
|
|
id="types"
|
|
property="model"
|
|
conn="conn"
|
|
lot="hash"
|
|
result-index="1"
|
|
on-status-changed="refreshTitle">
|
|
CALL item_available ();
|
|
SELECT DISTINCT t.tipo_id, l.str name
|
|
FROM vn2008.Tipos t
|
|
JOIN vn2008.Articles a ON a.tipo_id = t.tipo_id
|
|
LEFT JOIN vn_locale.family_view l ON l.family_id = t.tipo_id
|
|
JOIN tmp.item_available i ON i.item_id = a.Id_Article
|
|
WHERE t.reino_id = #realm
|
|
ORDER BY name
|
|
</db-model>
|
|
</vn-filter>
|
|
<vn-filter
|
|
id="test"
|
|
lot="hash"
|
|
name="color"
|
|
placeholder="_Color"
|
|
filter="filter">
|
|
<db-model property="model" auto-load="false" result-index="1">
|
|
CALL item_available ();
|
|
SELECT DISTINCT c.Id_Tinta, l.str name
|
|
FROM vn2008.Tintas c
|
|
JOIN vn2008.Articles a ON a.Color = c.Id_Tinta
|
|
JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id
|
|
LEFT JOIN vn_locale.color_view l ON l.color_id = c.Id_Tinta
|
|
JOIN tmp.item_available i ON i.item_id = a.Id_Article
|
|
WHERE #filter
|
|
ORDER BY name
|
|
</db-model>
|
|
</vn-filter>
|
|
<vn-filter
|
|
lot="hash"
|
|
name="producer"
|
|
placeholder="_Producer"
|
|
filter="filter">
|
|
<db-model property="model" auto-load="false" result-index="1">
|
|
CALL item_available ();
|
|
SELECT DISTINCT p.producer_id, p.name
|
|
FROM vn2008.producer p
|
|
JOIN vn2008.Articles a ON a.producer_id = p.producer_id
|
|
JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id
|
|
JOIN tmp.item_available i ON i.item_id = a.Id_Article
|
|
WHERE #filter
|
|
ORDER BY name
|
|
</db-model>
|
|
</vn-filter>
|
|
<vn-filter
|
|
lot="hash"
|
|
name="origin"
|
|
placeholder="_Origin"
|
|
filter="filter">
|
|
<db-model property="model" auto-load="false" result-index="1">
|
|
CALL item_available ();
|
|
SELECT DISTINCT o.id, l.str name, o.Abreviatura
|
|
FROM vn2008.Origen o
|
|
JOIN vn2008.Articles a ON a.id_origen = o.id
|
|
JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id
|
|
LEFT JOIN vn_locale.origin_view l ON l.origin_id = o.id
|
|
JOIN tmp.item_available i ON i.item_id = a.Id_Article
|
|
WHERE #filter
|
|
ORDER BY name
|
|
</db-model>
|
|
</vn-filter>
|
|
<vn-filter
|
|
lot="hash"
|
|
name="category"
|
|
placeholder="_Category"
|
|
filter="filter">
|
|
<db-model property="model" auto-load="false" result-index="1">
|
|
CALL item_available ();
|
|
SELECT DISTINCT a.Categoria, a.Categoria category
|
|
FROM vn2008.Articles a
|
|
JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id
|
|
JOIN tmp.item_available i ON i.item_id = a.Id_Article
|
|
WHERE #filter
|
|
ORDER BY a.Categoria
|
|
</db-model>
|
|
</vn-filter>
|
|
</div>
|
|
<div id="order" class="order">
|
|
<h2><t>Order by</t></h2>
|
|
<select on-change="onOrderChange">
|
|
<option value="A|Article" selected="true">
|
|
<t>Name</t>
|
|
</option>
|
|
<option value="A|price">
|
|
<t>Lower price</t>
|
|
</option>
|
|
<option value="D|price">
|
|
<t>Higher price</t>
|
|
</option>
|
|
<option value="A|available">
|
|
<t>Available</t>
|
|
</option>
|
|
<option value="A|Medida">
|
|
<t>Lower size</t>
|
|
</option>
|
|
<option value="D|Medida">
|
|
<t>Higher size</t>
|
|
</option>
|
|
<option value="A|color">
|
|
<t>Color</t>
|
|
</option>
|
|
<option value="A|producer">
|
|
<t>Producer</t>
|
|
</option>
|
|
<option value="A|Abreviatura">
|
|
<t>Origin</t>
|
|
</option>
|
|
<option value="A|Categoria">
|
|
<t>Category</t>
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<htk-popup id="desc-popup">
|
|
<div
|
|
property="child-node"
|
|
class="desc-popup"
|
|
id="description"/>
|
|
</htk-popup>
|
|
<htk-popup
|
|
id="card-popup"
|
|
modal="true"
|
|
on-closed="onPopupClose">
|
|
<div property="child-node" class="item-card">
|
|
<div class="top">
|
|
<htk-image
|
|
directory="catalog"
|
|
subdir="200x200"
|
|
lot="card"
|
|
name="Foto"
|
|
full-dir="900x900"
|
|
conn="conn"
|
|
editable="true"/>
|
|
<div class="item-info">
|
|
<h2>
|
|
<htk-text lot="card" name="Article"/>
|
|
</h2>
|
|
<p class="producer">
|
|
<htk-text lot="card" name="producer"/>
|
|
</p>
|
|
<p>
|
|
<t>Size</t> <htk-text lot="card" name="Medida"/>,
|
|
<t>Category</t> <htk-text lot="card" name="Categoria"/>
|
|
</p>
|
|
<p class="color">
|
|
<t>Color</t> <htk-text lot="card" name="color"/>
|
|
<htk-text lot="card" name="Tallos" format="_, %.0d Units"/>
|
|
</p>
|
|
<p>
|
|
<t>Origin</t> <htk-text lot="card-extend" name="origin"/>
|
|
</p>
|
|
</div>
|
|
<p class="desc">
|
|
<htk-text lot="card-extend" name="description" id="desc"/>
|
|
</p>
|
|
</div>
|
|
<htk-grid class="lots-grid" model="item-lots" show-header="false">
|
|
<htk-column-text title="_Store" column="warehouse"/>
|
|
<htk-column-spin title="_Price" column="price" unit="€" digits="2"/>
|
|
<htk-column-text title="_Pack" column="grouping" format="x%.0d"/>
|
|
<htk-column-button
|
|
column="id"
|
|
icon="add"
|
|
tip="_Add"
|
|
on-clicked="onAddLotClick"/>
|
|
</htk-grid>
|
|
<div class="footer">
|
|
<button on-click="onEraseClick" title="_Erase" class="erase">
|
|
<htk-icon
|
|
icon="delete"
|
|
theme="dark"
|
|
alt="_Erase"/>
|
|
</button>
|
|
<htk-text id="amount"/>
|
|
<button on-click="onConfirmClick" title="_Confirm" class="confirm">
|
|
<htk-icon
|
|
icon="ok"
|
|
theme="dark"
|
|
alt="_Confirm"/>
|
|
</button>
|
|
<div class="clear"/>
|
|
</div>
|
|
</div>
|
|
</htk-popup>
|
|
<!--
|
|
<htk-combo on-change="onOrderChange">
|
|
<vn-json-model property="model">
|
|
<array>
|
|
<object way="A" field="Article" desc="_Name"/>
|
|
<object way="A" field="price" desc="_Lower price"/>
|
|
<object way="D" field="price" desc="_Higher price"/>
|
|
<object way="A" field="available" desc="_Available"/>
|
|
<object way="A" field="Medida" desc="_Lower size"/>
|
|
<object way="D" field="Medida" desc="_Higher size"/>
|
|
<object way="A" field="color" desc="_Color"/>
|
|
<object way="A" field="producer" desc="_Producer"/>
|
|
<object way="A" field="Abreviatura" desc="_Origin"/>
|
|
<object way="A" field="Categoria" desc="_Category"/>
|
|
</array>
|
|
</vn-json-model>
|
|
</htk-combo>
|
|
-->
|
|
</vn> |