0
1
Fork 0
This commit is contained in:
Juan Ferrer Toribio 2017-04-07 13:00:33 +02:00
parent 944a955068
commit 0be33631ca
38 changed files with 410 additions and 579 deletions

View File

@ -2,21 +2,17 @@
<vn-group>
<db-form id="user-form">
<db-model property="model" id="user-model" updatable="true">
<custom>
SELECT user_id, default_address
FROM customer_view c
</custom>
</db-model>
</db-form>
<db-model id="addresses" updatable="true">
<custom>
SELECT a.id, a.consignee, p.name province, a.zip_code,
a.city, a.name, a.active, c.Pais country
FROM address_view a
LEFT JOIN vn2008.province p ON a.province_id = p.province_id
JOIN vn2008.Paises c ON c.Id = p.Paises_Id
WHERE active != FALSE
</custom>
</db-model>
</vn-group>
<h1 id="title">

View File

@ -8,19 +8,13 @@
property="model"
updatable="true"
mode="ON_DEMAND"
lot="hash"
on-operations-done="onOperationsDone">
<custom>
SELECT a.id, a.name, a.consignee, a.city, a.zip_code, a.province_id, c.Id country_id
FROM address_view a
LEFT JOIN vn2008.province p ON p.province_id = a.province_id
JOIN vn2008.Paises c ON c.Id = p.Paises_Id
WHERE active != FALSE AND a.id = #address
</custom>
<sql-batch property="batch">
<custom>
<item name="address" param="address"/>
</custom>
</sql-batch>
</db-model>
</db-form>
</vn-group>
@ -65,10 +59,8 @@
name="country_id"
one-way="true"/>
<db-model property="model">
<custom>
SELECT Id, Pais FROM vn2008.Paises
ORDER BY Pais
</custom>
</db-model>
</htk-combo>
</div>
@ -76,16 +68,9 @@
<label><t>Province</t></label>
<htk-combo lot="iter" name="province_id">
<db-model property="model">
<custom>
SELECT province_id, name FROM vn2008.province
WHERE Paises_Id = #country
ORDER BY name
</custom>
<sql-batch property="batch">
<custom>
<item name="country" param="country"/>
</custom>
</sql-batch>
</db-model>
</htk-combo>
</div>

View File

@ -1,18 +1,9 @@
<vn>
<vn-group>
<vn-param id="user"/>
<vn-hash-param key="user" param="user"/>
<db-form id="user-form">
<db-model property="model">
<custom>
<db-model property="model" lot="hash">
SELECT Id_Cliente, Cliente, Telefono, movil
FROM vn2008.Clientes WHERE Id_Cliente = #user
</custom>
<sql-batch property="batch">
<custom>
<item name="user" param="user"/>
</custom>
</sql-batch>
</db-model>
</db-form>
</vn-group>
@ -37,8 +28,7 @@
<div class="card">
<div>
<htk-repeater form-id="iter">
<db-model property="model">
<custom>
<db-model property="model" lot="hash">
SELECT u.stamp, a.platform, a.browser, a.version, a.javascript, a.cookies
FROM visitUser u
JOIN visitAccess c ON c.id = u.access
@ -46,12 +36,6 @@
WHERE u.user = #user
ORDER BY u.stamp DESC
LIMIT 8
</custom>
<sql-batch property="batch">
<custom>
<item name="user" param="user"/>
</custom>
</sql-batch>
</db-model>
<custom>
<div class="list-row">

View File

@ -21,7 +21,6 @@
<div class="card list">
<htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model property="model" id="sessions" on-status-changed="onModelStatusChange">
<custom>
SELECT vu.user userId, vu.stamp, c.Cliente, s.lastUpdate,
a.platform, a.browser, a.version, u.name user
FROM userSession s
@ -32,7 +31,6 @@
JOIN account.user u ON u.id = vu.user
JOIN vn2008.Clientes c ON c.Id_cliente = vu.user
ORDER BY lastUpdate DESC
</custom>
</db-model>
<custom>
<a id="link" class="list-row" title="_Access log">

View File

@ -6,10 +6,8 @@
<div class="card list">
<htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model property="model">
<custom>
SELECT image, name, description, link FROM link
ORDER BY name
</custom>
</db-model>
<custom>
<a id="link" class="list-row" target="_blank">

View File

@ -20,9 +20,7 @@
<label><t>Collection</t></label>
<htk-combo id="schema">
<db-model property="model">
<custom>
SELECT name, `desc` FROM image_schema ORDER BY `desc`
</custom>
</db-model>
</htk-combo>
<input type="hidden" name="schema" id="schema-field"/>

View File

@ -20,12 +20,10 @@
on-changed="onConfigChange"
on-ready="onConfigChange">
<db-model property="model" id="configs-model">
<custom>
SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family,
c.shelf, c.maxAmount, c.showPacking, c.stack, t.reino_id realm
FROM shelfConfig c
JOIN vn2008.Tipos t ON t.tipo_id = c.family
</custom>
</db-model>
</htk-combo>
</div>
@ -37,26 +35,17 @@
<label><t>Reign</t></label>
<htk-combo lot="set" name="realm" id="realm">
<db-model property="model">
<custom>
SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino
</custom>
</db-model>
</htk-combo>
</div>
<div>
<label><t>Family</t></label>
<htk-combo lot="set" name="family">
<db-model property="model">
<custom>
<db-model property="model" lot="config">
SELECT tipo_id, Tipo FROM vn2008.Tipos
WHERE reino_id = #realm ORDER BY Tipo
</custom>
<sql-batch property="batch">
<custom>
<item name="realm" param="realm"/>
</custom>
</sql-batch>
</db-model>
</htk-combo>
</div>
@ -64,10 +53,8 @@
<label><t>Store</t></label>
<htk-combo lot="set" name="warehouse">
<db-model property="model">
<custom>
SELECT id, name FROM vn2008.warehouse
WHERE reserve ORDER BY name
</custom>
</db-model>
</htk-combo>
</div>
@ -75,9 +62,7 @@
<label><t>Shelf</t></label>
<htk-combo lot="set" name="shelf">
<db-model property="model">
<custom>
SELECT id, name FROM shelf
</custom>
</db-model>
</htk-combo>
</div>

View File

@ -1,20 +1,14 @@
<vn>
<vn-group>
<vn-param id="user-name"/>
<vn-hash-param key="user" param="user-name"/>
</vn-group>
<h1 id="title">
<t>UserManagement</t>
</h1>
<div id="actions">
<htk-search-entry
param="user-name"/>
<htk-search-entry lot="hash" name="user"/>
</div>
<div id="main" class="users">
<div class="card list">
<htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model property="model">
<custom>
<db-model property="model" lot="hash">
SELECT u.id, u.name, c.Cliente
FROM account.user u
INNER JOIN vn2008.Clientes c ON u.id = c.Id_Cliente
@ -22,12 +16,6 @@
OR c.Cliente LIKE CONCAT('%', #user, '%')
OR u.id = #user
ORDER BY u.name LIMIT 200
</custom>
<sql-batch property="batch">
<custom>
<item name="user" param="user-name"/>
</custom>
</sql-batch>
</db-model>
<custom>
<a id="link" class="list-row" title="_AccessLog">

View File

@ -16,15 +16,11 @@
<div class="card form">
<div>
<label><t>From</t></label>
<htk-date-chooser>
<vn-param property="param" id="from"/>
</htk-date-chooser>
<htk-date-chooser lot="hash" name="from"/>
</div>
<div>
<label><t>To</t></label>
<htk-date-chooser>
<vn-param property="param" id="to"/>
</htk-date-chooser>
<htk-date-chooser lot="hash" name="to"/>
</div>
</div>
<div class="summary card form">
@ -47,8 +43,7 @@
</div>
<div class="card list ">
<htk-repeater form-id="iter" empty-message="_Select date interval">
<db-model property="model" id="visits">
<custom>
<db-model property="model" id="visits" lot="hash">
SELECT browser
,MIN(CAST(version AS DECIMAL(4,1))) minVersion
,MAX(CAST(version AS DECIMAL(4,1))) maxVersion
@ -60,14 +55,8 @@
JOIN visitAgent a ON c.agent = a.id
JOIN visit v ON a.visit = v.id
WHERE c.stamp BETWEEN TIMESTAMP(#from,'00:00:00') AND TIMESTAMP(#to,'23:59:59')
GROUP BY browser ORDER BY visits DESC
</custom>
<sql-batch property="batch">
<custom>
<item name="from" param="from"/>
<item name="to" param="to"/>
</custom>
</sql-batch>
GROUP BY browser
ORDER BY visits DESC
</db-model>
<custom>
<div class="list-row">

View File

@ -5,8 +5,13 @@ Hedera.Visits = new Class
,activate: function ()
{
this.$('from').value = new Date ();
this.$('to').value = new Date ();
var hash = this.hash;
if (!hash.get ('to'))
{
hash.set ('from', new Date ());
hash.set ('to', new Date ());
}
}
,onRefreshClick: function ()

View File

@ -6,9 +6,7 @@
<div class="card">
<htk-grid>
<db-model property="model">
<custom>
CALL vn2008.agencia_volume ()
</custom>
</db-model>
<htk-column-button
column="agency_id"

View File

@ -1,23 +1,12 @@
<vn>
<vn-group>
<vn-param id="agency"/>
<vn-hash-param key="agency" param="agency"/>
</vn-group>
<h1 id="title">
<t>ByProvince</t>
</h1>
<div id="main" class="provinces">
<div class="card">
<htk-grid>
<db-model property="model">
<custom>
<db-model property="model" lot="hash">
CALL vn2008.desglose_volume (#agency)
</custom>
<sql-batch property="batch">
<custom>
<item name="agency" param="agency"/>
</custom>
</sql-batch>
</db-model>
<htk-column-text title="_Province" column="Provincia"/>
<htk-column-spin title="_Expeditions" column="expediciones"/>

View File

@ -13,10 +13,8 @@
<div class="column mansonry" id="news-column">
<htk-repeater form-id="new">
<db-model property="model">
<custom>
SELECT title, date_time, text, image, id FROM news
ORDER BY priority, date_time DESC
</custom>
</db-model>
<custom>
<div class="masonry-box">

View File

@ -6,11 +6,9 @@
<div class="column mansonry" id="news-column">
<htk-repeater form-id="new">
<db-model property="model">
<custom>
SELECT title, date_time, text, image, id FROM news
WHERE tag = 'course'
ORDER BY priority, date_time DESC
</custom>
</db-model>
<custom>
<div class="masonry-box">

View File

@ -28,13 +28,11 @@
</div>
<htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model id="items" property="model" updatable="true">
<custom>
SELECT i.id, i.amount, i.price, a.Article, a.Categoria,
a.Medida, a.Tallos, a.Color, o.Abreviatura, a.Foto
FROM basket_item i
JOIN vn2008.Articles a ON a.Id_Article = i.item_id
LEFT JOIN vn2008.Origen o ON a.id_origen = o.id
</custom>
</db-model>
<custom>
<div class="line">

View File

@ -42,26 +42,21 @@
</sql-filter>
<db-form id="basket" on-ready="onBasketReady">
<db-model property="model">
<custom>
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
</custom>
</db-model>
</db-form>
<db-query id="basket-lines">
<custom>
SELECT item_id, warehouse_id, SUM(amount) amount
FROM basket_item
GROUP BY warehouse_id
</custom>
</db-query>
<db-model
id="items-model"
result-index="2"
on-status-changed="onItemsChange">
<custom>
CREATE TEMPORARY TABLE tmp.bionic_calc
(INDEX (item_id))
ENGINE=MEMORY
@ -80,7 +75,6 @@
WHERE b.available > 0
ORDER BY a.Article, a.Medida
LIMIT 400;
</custom>
<sql-batch property="batch" id="filter-batch">
<custom>
<item name="filter" object="filter"/>
@ -98,12 +92,10 @@
property="model"
batch="card-batch"
on-status-changed-after="onStatusChange">
<custom>
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
</custom>
</db-model>
</db-form>
<db-model
@ -111,14 +103,12 @@
result-index="1"
on-status-changed-after="onStatusChange"
batch="card-batch">
<custom>
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;
</custom>
</db-model>
</vn-group>
<h1 id="title">
@ -216,13 +206,11 @@
id="realms-model"
property="model"
on-status-changed="refreshTitleColor">
<custom>
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
</custom>
</db-model>
<custom>
<a id="link" class="clickable">
@ -247,7 +235,6 @@
conn="conn"
result-index="1"
on-status-changed="refreshTitle">
<custom>
CALL item_available ();
SELECT DISTINCT t.tipo_id, l.str name
FROM vn2008.Tipos t
@ -256,7 +243,6 @@
JOIN tmp.item_available i ON i.item_id = a.Id_Article
WHERE #filter
ORDER BY name
</custom>
</db-model>
<sql-filter property="filter" type="AND">
<sql-filter-item type="EQUAL">
@ -269,7 +255,6 @@
placeholder="_Color"
param="color">
<db-model property="model" auto-load="false" result-index="1">
<custom>
CALL item_available ();
SELECT DISTINCT c.Id_Tinta, l.str name
FROM vn2008.Tintas c
@ -279,12 +264,11 @@
JOIN tmp.item_available i ON i.item_id = a.Id_Article
WHERE #filter
ORDER BY name
</custom>
</db-model>
<sql-filter property="filter" always-ready="true" type="AND">
<pointer object="op-realm"/>
<pointer object="op-type"/>
<pointer object="op-name"/>
<pointer object="op-name="/>
<pointer object="op-origin"/>
<pointer object="op-category"/>
<pointer object="op-producer"/>
@ -294,7 +278,6 @@
placeholder="_Producer"
param="producer">
<db-model property="model" auto-load="false" result-index="1">
<custom>
CALL item_available ();
SELECT DISTINCT p.producer_id, p.name
FROM vn2008.producer p
@ -303,12 +286,11 @@
JOIN tmp.item_available i ON i.item_id = a.Id_Article
WHERE #filter
ORDER BY name
</custom>
</db-model>
<sql-filter property="filter" always-ready="true" type="AND">
<pointer object="op-realm"/>
<pointer object="op-type"/>
<pointer object="op-name"/>
<pointer object="op-name="/>
<pointer object="op-origin"/>
<pointer object="op-color"/>
<pointer object="op-category"/>
@ -318,7 +300,6 @@
placeholder="_Origin"
param="origin">
<db-model property="model" auto-load="false" result-index="1">
<custom>
CALL item_available ();
SELECT DISTINCT o.id, l.str name, o.Abreviatura
FROM vn2008.Origen o
@ -328,12 +309,11 @@
JOIN tmp.item_available i ON i.item_id = a.Id_Article
WHERE #filter
ORDER BY name
</custom>
</db-model>
<sql-filter property="filter" always-ready="true" type="AND">
<pointer object="op-realm"/>
<pointer object="op-type"/>
<pointer object="op-name"/>
<pointer object="op-name="/>
<pointer object="op-color"/>
<pointer object="op-category"/>
<pointer object="op-producer"/>
@ -343,7 +323,6 @@
placeholder="_Category"
param="category">
<db-model property="model" auto-load="false" result-index="1">
<custom>
CALL item_available ();
SELECT DISTINCT a.Categoria, a.Categoria category
FROM vn2008.Articles a
@ -351,12 +330,11 @@
JOIN tmp.item_available i ON i.item_id = a.Id_Article
WHERE #filter
ORDER BY a.Categoria
</custom>
</db-model>
<sql-filter property="filter" always-ready="true" type="AND">
<pointer object="op-realm"/>
<pointer object="op-type"/>
<pointer object="op-name"/>
<pointer object="op-name="/>
<pointer object="op-color"/>
<pointer object="op-origin"/>
<pointer object="op-producer"/>
@ -433,14 +411,14 @@
</p>
<p class="color">
<t>Color</t> <htk-text lot="card" name="color"/>
<htk-text lot="card" name"Tallos" format="_, %.0d Units"/>
<htk-text lot="card" name="Tallos" format="_, %.0d Units"/>
</p>
<p>
<t>Origin</t> <htk-text lot="card-extend" name"origin"/>
<t>Origin</t> <htk-text lot="card-extend" name="origin"/>
</p>
</div>
<p class="desc">
<htk-text lot="card-extend" name"description" id="desc"/>
<htk-text lot="card-extend" name="description" id="desc"/>
</p>
</div>
<htk-grid class="lots-grid" model="item-lots" show-header="false">

View File

@ -39,11 +39,12 @@ Hedera.Checkout = new Class
date.setHours (0, 0, 0, 0);
}
this.$('date').value = date;
this.$('method').value = i.get ('delivery_method');
this.$('agency').value = i.get ('agency_id');
this.$('address').value = i.get ('address_id');
this.$('lot').assign ({
date: date,
method: i.get ('delivery_method'),
agency: i.get ('agency_id'),
address: i.get ('address_id')
});
this.autoStepLocked = false;
}
@ -59,15 +60,8 @@ Hedera.Checkout = new Class
this.disableButtons (true);
var query = 'CALL basketConfigure (#date, #method, #agency, #address)';
var batch = new Sql.Batch ();
batch.addParam ('method', this.$('method'));
batch.addParam ('date', this.$('date'));
batch.addParam ('agency', this.$('agency'));
batch.addParam ('address', this.$('address'));
this.conn.execQuery (query,
this.onBasketConfigured.bind (this), batch);
this.onBasketConfigured.bind (this), this.$('lot').params);
}
,onBasketConfigured: function (resultSet)
@ -82,7 +76,7 @@ Hedera.Checkout = new Class
else
Htk.Toast.showMessage (_('OrderStarted'));
this.hash.setAll ({'form': 'ecomerce/catalog'});
this.hash.setAll ({form: 'ecomerce/catalog'});
}
,onCancelClick: function ()
@ -162,7 +156,7 @@ Hedera.Checkout = new Class
,onAddressClick: function (addressId)
{
this.$('address').value = addressId;
this.$('lot').set ('address', addressId);
this.goNextStep ();
}
@ -171,7 +165,7 @@ Hedera.Checkout = new Class
if (this.selectedNode)
Vn.Node.removeClass (this.selectedNode, 'selected');
var row = this.$('addresses').search ('id', this.$('address').value);
var row = this.$('addresses').search ('id', this.$('lot').get ('address'));
if (row != -1)
{

View File

@ -1,47 +1,25 @@
<vn>
<vn-group>
<vn-param id="method"/>
<vn-param id="date"/>
<vn-param id="agency"/>
<vn-param id="address" on-changed="onAddressChange"/>
<vn-basic-set id="lot" on-change="onAddressChange"/>
<db-form id="defaults" on-ready="onValuesReady">
<db-model property="model">
<custom>
SELECT delivery_method, agency_id, address_id
FROM basket_defaults
</custom>
</db-model>
</db-form>
<db-form id="order-form" on-ready="onValuesReady">
<db-model property="model">
<custom>
SELECT d.code delivery_method, o.date_send, o.agency_id, o.address_id
FROM basket o
JOIN vn.deliveryMethod d ON d.id = o.delivery_method_id
</custom>
</db-model>
</db-form>
<db-model id="agencies" auto-load="false" on-status-changed="onAgenciesReady">
<custom>
CALL vn.agencyListForMethod(#date, #address, 'AGENCY')
</custom>
<sql-batch property="batch">
<custom>
<item name="address" param="address"/>
<item name="date" param="date"/>
</custom>
</sql-batch>
</db-model>
<db-model id="warehouses" auto-load="false" on-status-changed="onWarehousesReady">
<custom>
CALL vn.agencyListForMethod(#date, #address, 'PICKUP')
</custom>
<sql-batch property="batch">
<custom>
<item name="address" param="address"/>
<item name="date" param="date"/>
</custom>
</sql-batch>
<db-model
id="agencies"
lot="lot"
auto-load="false"
on-status-changed="onAgenciesReady">
CALL vn.agencyListForMethod(#date, #address, #method)
</db-model>
</vn-group>
<h1 id="title">
@ -66,6 +44,8 @@
<div class="answers radio">
<htk-radio-group
id="rg-method"
lot="lot"
name="method"
param="method"
on-changed="onFieldChange"/>
<div>
@ -103,21 +83,19 @@
on-change="onAddressChange"
renderer="addressRenderer">
<db-model property="model" id="addresses">
<custom>
SELECT a.id, a.consignee, p.name province, a.zip_code, a.city, a.name, a.active, c.Pais country
FROM address_view a
LEFT JOIN vn2008.province p ON a.province_id = p.province_id
JOIN vn2008.Paises c ON c.Id = p.Paises_Id
WHERE active != FALSE
</custom>
</db-model>
<custom>
<div class="address" id="address">
<p class="consignee">
<htk-text lot="iter" name"consignee"/>
<htk-text lot="iter" name="consignee"/>
</p>
<p>
<htk-text lot="iter" name"name"/>
<htk-text lot="iter" name="name"/>
</p>
</div>
</custom>
@ -129,7 +107,8 @@
<div class="answers target">
<htk-combo
id="agency-combo"
param="agency"
lot="lot"
name="agency"
on-changed="onFieldChange"
model="agencies"/>
</div>
@ -139,7 +118,8 @@
<div class="answers target">
<htk-combo
id="warehouse-combo"
param="agency"
lot="lot"
name="agency"
on-changed="onFieldChange"
model="warehouses"/>
</div>
@ -152,11 +132,11 @@
<htk-text format="%D" param="date"/>
</p>
<p>
<htk-text lot="address-form" name"name"/>
<htk-text lot="address-form" name="name"/>
</p>
<p>
<t>Agency</t>
<htk-text lot="agency-combo" name"description"/>
<htk-text lot="agency-combo" name="description"/>
</p>
<button id="confirm-agency" class="thin" on-click="onConfirmClick">
<t>Confirm</t>
@ -172,7 +152,7 @@
<htk-text format="%D" param="date"/>
</p>
<p>
<htk-text lot="address-form" name"name"/>
<htk-text lot="address-form" name="name"/>
</p>
<p>
<t>ReceiveThroughtRoute</t>
@ -192,7 +172,7 @@
</p>
<p>
<t>Warehouse</t>
<htk-text lot="warehouse-combo" name"description"/>
<htk-text lot="warehouse-combo" name="description"/>
</p>
<button id="confirm-pickup" class="thin" on-click="onConfirmClick">
<t>Confirm</t>

View File

@ -50,11 +50,14 @@ Hedera.Confirm = new Class
Htk.Toast.showWarning (
_('You have exceeded your credit.'));
this.$('debt').value = debt;
this.$('total-debt').value = totalDebt;
this.$('total-amount').value = totalDebt;
this.$('credit-excess').value = exceededCredit;
this.$('excess-amount').value = exceededCredit;
this.$('lot').assign ({
debt: debt,
totalDebt: totalDebt,
totalAmount: totalDebt,
creditExcess: exceededCredit,
excessAmount: exceededCredit,
payAmount: 'ALL'
});
this.$('pay-amount').value = 'ALL';
@ -66,7 +69,7 @@ Hedera.Confirm = new Class
{
this.$('amount-selector').style.display = 'block';
this.$('exceeded-info').style.display = 'table-row';
this.$('pay-amount').value = 'EXCEEDED';
lot.assign ({payAmount: 'EXCEEDED'});
}
}
@ -93,7 +96,7 @@ Hedera.Confirm = new Class
for (var i = 0; i < methods.length; i++)
this.$(methods[i] +'-method').style.display = 'block';
this.$('pay-method').value = selectedMethod;
lot.assign ({payAmount: selectedMethod});
}
,onPayMethodChange: function (payMethod)

View File

@ -1,8 +1,8 @@
<vn>
<vn-group>
<vn-basic-set id="lot"/>
<db-form id="order-form" on-ready="onOrderReady">
<db-model property="model" result-index="1">
<custom>
CALL basket_get_vat ();
SELECT o.id, o.date_send, o.note, o.company_id,
ag.description agency, v.code method,
@ -20,13 +20,10 @@
FROM t_order_vat
) t;
DROP TEMPORARY TABLE t_order_vat;
</custom>
</db-model>
</db-form>
<db-query id="confirm-query" on-ready="onConfirm">
<custom>
CALL basket_confirm ()
</custom>
</db-query>
</vn-group>
<h1 id="title">
@ -38,23 +35,23 @@
<div class="delivery">
<p>
<t>Delivery at</t>
<htk-text format="%D" lot="order-form" name"date_send"/>
<htk-text format="%D" lot="order-form" name="date_send"/>
</p>
<p>
<span id="method"><t>Agency</t></span>
<htk-text lot="order-form" name"agency"/>
<htk-text lot="order-form" name="agency"/>
</p>
</div>
<div id="address" class="address">
<p>
<htk-text lot="order-form" name"consignee"/>
<htk-text lot="order-form" name="consignee"/>
</p>
<p>
<htk-text lot="order-form" name"address"/>
<htk-text lot="order-form" name="address"/>
</p>
<p>
<htk-text lot="order-form" name"zip_code"/>,
<htk-text lot="order-form" name"city"/>
<htk-text lot="order-form" name="zip_code"/>,
<htk-text lot="order-form" name="city"/>
</p>
</div>
</div>
@ -68,7 +65,7 @@
<t>Previous balance</t>
</td>
<td class="currency">
<htk-text format="%.2d€" id="debt"/>
<htk-text format="%.2d€" lot="lot" name="debt"/>
</td>
</tr>
<tr>
@ -76,7 +73,7 @@
<t>Order total</t>
</td>
<td class="currency">
<htk-text format="%.2d€" lot="order-form" name"tax_base"/>
<htk-text format="%.2d€" lot="order-form" name="tax_base"/>
</td>
</tr>
<tr>
@ -84,7 +81,7 @@
<t>Order VAT</t>
</td>
<td class="currency">
<htk-text format="%.2d€" lot="order-form" name"vat"/>
<htk-text format="%.2d€" lot="order-form" name="vat"/>
</td>
</tr>
<tr class="total-debt sum-total">
@ -92,7 +89,7 @@
<t>Total debt</t>
</td>
<td class="currency">
<htk-text format="%.2d€" id="total-debt"/>
<htk-text format="%.2d€" lot="lot" name="totalDebt"/>
</td>
</tr>
<tr id="credit-info" class="credit-info">
@ -100,7 +97,7 @@
<t>Credit</t>
</td>
<td class="currency">
<htk-text format="%.2d€" lot="order-form" name"credit"/>
<htk-text format="%.2d€" lot="order-form" name="credit"/>
</td>
</tr>
<tr id="exceeded-info" class="exceeded-info sum-total">
@ -108,7 +105,7 @@
<t>Exceeded credit</t>
</td>
<td class="currency">
<htk-text format="%.2d€" id="credit-excess"/>
<htk-text format="%.2d€" lot="lot" name="creditExcess"/>
</td>
</tr>
</tbody>
@ -125,14 +122,14 @@
<htk-radio radio-group="pay-amount" value="ALL"/>
<label>
<t>Total debt</t>,
<htk-text format="%.2d€" id="total-amount"/>
<htk-text format="%.2d€" lot="lot" name="totalAmount"/>
</label>
</div>
<div>
<htk-radio radio-group="pay-amount" value="EXCEEDED"/>
<label>
<t>Exceeded credit</t>,
<htk-text format="%.2d€" id="excess-amount"/>
<htk-text format="%.2d€" lot="lot" name="excessAmount"/>
</label>
</div>
</div>
@ -143,7 +140,8 @@
</h2>
<div class="pay-methods radio">
<htk-radio-group
id="pay-method"
lot="lot"
name="payMethod"
on-changed="onPayMethodChange"/>
<div id="balance-method">
<htk-radio radio-group="pay-method" value="BALANCE"/>
@ -181,14 +179,14 @@
<custom>
<div class="transfer-account">
<p>
<htk-text lot="iter" name"description"/>
<htk-text lot="iter" name="description"/>
</p>
<p>
<htk-text lot="iter" name"iban"/>
<htk-text lot="iter" name"entity_id"/>
<htk-text lot="iter" name"office"/>
<htk-text lot="iter" name"dc"/>
<htk-text lot="iter" name"number"/>
<htk-text lot="iter" name="iban"/>
<htk-text lot="iter" name="entity_id"/>
<htk-text lot="iter" name="office"/>
<htk-text lot="iter" name="dc"/>
<htk-text lot="iter" name="number"/>
</p>
</div>
</custom>

View File

@ -7,12 +7,10 @@
<div>
<htk-grid show-header="false">
<db-model property="model" id="tickets">
<custom>
SELECT invoice_id, serial_num, issued, amount
FROM invoice_view
ORDER BY issued DESC
LIMIT 100
</custom>
</db-model>
<htk-column-text title="_Serial" column="serial_num"/>
<htk-column-date title="_Date" column="issued" format="_%e %b %Y"/>

View File

@ -11,12 +11,12 @@ Hedera.Orders = new Class
});
this.tpv.check (this._onTpvCheck.bind (this));
if (!this.$('from').value)
if (!this.hash.get ('from'))
{
var from = new Date ();
from.setDate (from.getDate () - 30);
from.setHours (0, 0, 0, 0);
this.$('from').value = from;
this.hash.assign ({from: from});
}
}
@ -34,8 +34,8 @@ Hedera.Orders = new Class
,repeaterFunc: function (res, form)
{
res.$('link').href = this.hash.make ({
'form': 'ecomerce/ticket',
'ticket': form.get ('ticket_id')
form: 'ecomerce/ticket',
ticket: form.get ('ticket_id')
});
}

View File

@ -1,12 +1,8 @@
<vn>
<vn-group>
<vn-param id="from"/>
<vn-hash-param type="Date" key="from" param="from"/>
<db-form id="debt">
<db-model property="model">
<custom>
SELECT clientGetDebt() debt
</custom>
</db-model>
</db-form>
</vn-group>
@ -30,7 +26,7 @@
<t>Balance:</t>
</span>
<span class="amount" id="balance">
<htk-text lot="debt" name"debt" format="%.2d€"/>
<htk-text lot="debt" name="debt" format="%.2d€"/>
</span>
<img
src="image/icon/dark/info.svg"
@ -43,37 +39,30 @@
<div class="card form">
<div>
<label><t>Show orders from</t></label>
<htk-date-chooser param="from"/>
<htk-date-chooser lot="hash" name="from"/>
</div>
</div>
<div class="card list">
<htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model property="model" id="tickets">
<custom>
<db-model property="model" id="tickets" lot="hash">
CALL clientTicketList (#from, NULL)
</custom>
<sql-batch property="batch">
<custom>
<item name="from" param="from"/>
</custom>
</sql-batch>
</db-model>
<custom>
<a id="link" class="list-row" title="_SeeOrder">
<p class="important total">
<htk-text lot="iter" name"total" format="%.2d€"/>
<htk-text lot="iter" name="total" format="%.2d€"/>
</p>
<p class="important">
<htk-text lot="iter" name"date" format="%D"/>
<htk-text lot="iter" name="date" format="%D"/>
</p>
<p>
<htk-text lot="iter" name"consignee"/>
<htk-text lot="iter" name="consignee"/>
</p>
<p>
<htk-text lot="iter" name"type"/>
<htk-text lot="iter" name="type"/>
</p>
<p>
<htk-text lot="iter" name"ticket_id"/>
<htk-text lot="iter" name="ticket_id"/>
</p>
</a>
</custom>

View File

@ -1,17 +1,8 @@
<vn>
<vn-group>
<vn-param id="ticket-id" on-changed="onTicketChange"/>
<vn-hash-param key="ticket" param="ticket-id"/>
<db-form id="ticket">
<db-model property="model">
<custom>
<db-model property="model" lot="hash">
CALL clientTicketGet(#ticket)
</custom>
<sql-batch property="batch">
<custom>
<item name="ticket" param="ticket-id"/>
</custom>
</sql-batch>
</db-model>
</db-form>
</vn-group>
@ -29,67 +20,60 @@
<div class="head">
<div>
<p class="important ticket-id">
<htk-text name"id" lot="ticket"/>
<htk-text name="id" lot="ticket"/>
</p>
<p>
<htk-text lot="ticket" name"delivery" format="%D"/>
<htk-text lot="ticket" name="delivery" format="%D"/>
</p>
</div>
<div>
<p>
<t>Delivery</t> <htk-text lot="ticket" name"Agencia"/>
<t>Delivery</t> <htk-text lot="ticket" name="Agencia"/>
</p>
<p>
<htk-text lot="ticket" name"consignee"/>
<htk-text lot="ticket" name="consignee"/>
</p>
<p>
<htk-text lot="ticket" name"name"/>
<htk-text lot="ticket" name="name"/>
</p>
<p>
<htk-text lot="ticket" name"zip_code"/>
<htk-text lot="ticket" name"city"/>
(<htk-text lot="ticket" name"province"/>)
<htk-text lot="ticket" name="zip_code"/>
<htk-text lot="ticket" name="city"/>
(<htk-text lot="ticket" name="province"/>)
</p>
</div>
<div>
<p class="important total">
<t>Total</t>
<htk-text lot="ticket" name"total" format="%.2d€"/>
<htk-text lot="ticket" name="total" format="%.2d€"/>
</p>
<p class="important total">
<t>Total + VAT</t>
<htk-text lot="ticket" name"totalPlusVat" format="%.2d€"/>
<htk-text lot="ticket" name="totalPlusVat" format="%.2d€"/>
</p>
</div>
</div>
<htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model property="model" id="movements">
<custom>
<db-model property="model" id="movements" lot="hash">
CALL clientTicketRowGet(#ticket)
</custom>
<sql-batch property="batch">
<custom>
<item name="ticket" param="ticket-id"/>
</custom>
</sql-batch>
</db-model>
<custom>
<div class="line">
<htk-image
lot="iter"
name"Foto"
name="Foto"
class="photo"
directory="catalog"
subdir="200x200"
full-dir="900x900"/>
<p class="concept">
<htk-text lot="iter" name"concept"/>
<htk-text lot="iter" name"Medida"/>
<htk-text lot="iter" name"Categoria"/>
<htk-text lot="iter" name="concept"/>
<htk-text lot="iter" name="Medida"/>
<htk-text lot="iter" name="Categoria"/>
</p>
<p class="amount">
<htk-text lot="iter" name"amount"/> x
<htk-text lot="iter" name"price" format="%.2d€"/>
<htk-text lot="iter" name="amount"/> x
<htk-text lot="iter" name="price" format="%.2d€"/>
<span class="subtotal">
<htk-text id="subtotal" format="%.2d€"/>
</span>

View File

@ -63,7 +63,7 @@ Hedera.New = new Class
,onStatusChange: function (form)
{
if (this.$('new-id').value == 0)
if (this.hash.get('new') == 0)
form.insertRow ();
}

View File

@ -1,25 +1,17 @@
<vn>
<vn-group>
<vn-param id="new-id"/>
<vn-hash-param key="new" param="new-id"/>
<db-form id="iter" on-status-changed="onStatusChange">
<db-model
id="model"
property="model"
updatable="true"
lot="hash"
on-operations-done="onOperationsDone">
<custom>
SELECT id, title, text, tag
FROM news WHERE id = #new
</custom>
<sql-batch property="batch">
<custom>
<item name="new" param="new-id"/>
</custom>
</sql-batch>
</db-model>
</db-form>
<vn-param lot="iter" name"text" on-changed="onBodyChange"/>
<vn-param lot="iter" name="text" on-changed="onBodyChange"/>
</vn-group>
<h1 id="title">
<t>AddEditNew</t>
@ -38,16 +30,14 @@
<div class="card form">
<div>
<label><t>Title</t></label>
<htk-entry lot="iter" name"title"/>
<htk-entry lot="iter" name="title"/>
</div>
<div>
<label><t>Tag</t></label>
<htk-combo lot="iter" name"tag">
<htk-combo lot="iter" name="tag">
<db-model property="model">
<custom>
SELECT name, description FROM news_tag
ORDER BY description
</custom>
</db-model>
</htk-combo>
</div>

View File

@ -12,26 +12,24 @@
<div class="card">
<htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model property="model" id="news-model" updatable="true">
<custom>
SELECT n.id, c.Cliente, priority, image, title
FROM news n
JOIN vn2008.Clientes c ON n.user_id = c.Id_Cliente
ORDER BY priority, n.date_time DESC
</custom>
</db-model>
<custom>
<a id="link" class="list-row" title="_EditNew">
<div class="actions">
<htk-button
lot="iter"
name"id"
name="id"
tip="_Remove"
icon="delete"
on-click="onDeleteClick"/>
</div>
<htk-image
lot="iter"
name"image"
name="image"
class="photo"
directory="news"
subdir="200x200"
@ -39,14 +37,14 @@
editable="true"
conn="conn"/>
<p class="important">
<htk-text lot="iter" name"title"/>
<htk-text lot="iter" name="title"/>
</p>
<p>
<htk-text lot="iter" name"Cliente"/>
<htk-text lot="iter" name="Cliente"/>
</p>
<p>
<t>Priority</t>
<htk-text lot="iter" name"priority"/>
<htk-text lot="iter" name="priority"/>
</p>
</a>
</custom>

View File

@ -271,6 +271,9 @@ Model.implement
this._setStatus (Status.CLEAN);
}
/**
* Deprecated.
*/
,loadXml: function (builder, node)
{
this.parent (builder, node);
@ -281,6 +284,12 @@ Model.implement
this.query = query;
}
,appendChild: function (child)
{
if (child.nodeType === Node.TEXT_NODE)
this.query = child.textContent;
}
,_autoLoad: function ()
{
if (this.autoLoad)
@ -289,39 +298,43 @@ Model.implement
this.clean ();
}
/**
* Checks wether the model is ready to execute its query.
*
* @return {Boolean} %true if its ready, %false otherwise
*/
,isReady: function ()
{
if (!this._stmt || !this._conn)
return false;
var ids = this._stmt.findHolders ();
if (!ids)
return true;
if (!this._lot)
return false;
var lotParams = this._lot.params;
for (var i = 0; i < ids.length; i++)
if (lotParams[ids[i]] === undefined)
return false;
return true;
}
/**
* Refresh the model data reexecuting the query on the database.
*/
,refresh: function ()
{
var ready = false;
if (this._stmt && this._conn)
{
var ids = this._stmt.findHolders ();
if (ids)
{
if (this._batch && this._batch.isReady ())
{
ready = true;
for (var i = 0; i < ids.length; i++)
if (!this._batch.get (ids[i]))
{
ready = false;
break;
}
}
}
else
ready = true;
}
if (ready)
if (this.isReady ())
{
var params = this._lot ? this._lot.params : null;
this._setStatus (Status.LOADING);
this._conn.execStmt (this._stmt, this._selectDone.bind (this), this._batch);
this._conn.execStmt (this._stmt, this._selectDone.bind (this), params);
}
else
this.clean ();

View File

@ -181,7 +181,7 @@ module.exports = new Class
({
lot: this._hash,
type: Boolean,
key: 'guest'
name: 'guest'
});
this.link ({_isGuest: isGuest}, {'changed': this._onGuestChange});
@ -189,7 +189,7 @@ module.exports = new Class
({
lot: this._hash,
type: String,
key: 'token'
name: 'token'
});
this.link ({_token: token}, {'changed': this._onTokenChange});
}

View File

@ -40,7 +40,6 @@
left: 0;
display: none;
border: none;
background-color: transparent;
padding: 0 .4em;
margin: 0;
height: 100%;
@ -61,6 +60,9 @@
padding: .8em .6em;
padding-right: .3em;
margin: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.vn-gui .navbar > .htk-spinner
{

View File

@ -80,7 +80,7 @@ module.exports = new Class
this.formParam = new Vn.Param ({
lot: this.hash,
type: String,
key: 'form'
name: 'form',
});
this.formParam.on ('changed', this._onFormChange, this);

View File

@ -112,21 +112,21 @@ module.exports = new Class
*
* @param {Boolean} editable Whether the user is allowed to edit the entry
*/
,setEditable: function (editable) {}
,setEditable: function () {}
/**
* Virtual method that must be implemented by class childs to put the value
* on the associated entry.
*
* @param {Object} value The new value for the entry
* @param {*} value The new value for the entry
*/
,putValue: function (value) {}
,putValue: function () {}
/**
* Protected method that should be called from class childs when the value
* on the associated entry changes.
*
* @param {Object} value The new entry value
* @param {*} value The new entry value
*/
,valueChanged: function (value)
{

View File

@ -26,7 +26,7 @@ module.exports = new Class
/**
* Through the query looking for containers and adds it to the batch.
*
* @return {Object} The found statement parameters
* @return {Array} An array with the names of the found parameters
*/
,findHolders: function () {}
});

View File

@ -334,12 +334,11 @@ module.exports = new Class
for (var i = 0; i < childNodes.length; i++)
{
var child = childNodes[i];
var childContext = null;
var childTagName = null;
if (child.nodeType !== Node.ELEMENT_NODE)
continue;
var childContext;
var childTagName = child.tagName.toLowerCase ();
if (child.nodeType === Node.ELEMENT_NODE)
childTagName = child.tagName.toLowerCase ();
if (childTagName === 'pointer')
{
@ -351,7 +350,10 @@ module.exports = new Class
}
else if (childContext = this._compileNode (child))
{
var prop = child.getAttribute ('property');
var prop = null;
if (childTagName)
prop = child.getAttribute ('property');
if (prop)
{

View File

@ -23,17 +23,17 @@ module.exports = new Class
return this._param;
}
},
key:
name:
{
type: String
,set: function (x)
{
this._key = x;
this._name = x;
this._onLotChange ();
}
,get: function ()
{
return this._key;
return this._name;
}
},
value:
@ -96,16 +96,16 @@ module.exports = new Class
,_paramLock: false
,_value: undefined
,_lot: null
,_key: null
,_name: null
,_type: null
,_oneWay: false
,_onLotChange: function ()
{
if (this._lotLock || !this._key || !this._lot)
if (this._lotLock || !this._name || !this._lot)
return;
var newValue = this._lot.get (this._key, this._type);
var newValue = this._lot.get (this._name, this._type);
this._lotLock = true;
this._setValue (newValue, true);
@ -122,10 +122,10 @@ module.exports = new Class
this._value = newValue;
if (this._lot && this._key && !this._lotLock && !this._oneWay)
if (this._lot && this._name && !this._lotLock && !this._oneWay)
{
this._lotLock = true;
this._lot.set (this._key, newValue);
this._lot.set (this._name, newValue);
this._lotLock = false;
}

View File

@ -1,59 +1,55 @@
<vn>
<vn-group>
<db-form id="ticket">
<db-model property="model" id="ticket-data" conn="conn" batch="batch">
<custom>
<db-model property="model" id="ticket-data" conn="conn" lot="hash">
CALL clientTicketGet(#ticket)
</custom>
</db-model>
</db-form>
</vn-group>
<div id="report" class="sheet">
<h2>
<htk-text name"id" lot="ticket"/>
<htk-text name="id" lot="ticket"/>
</h2>
<div class="header">
<p>
<htk-text lot="ticket" name"consignee"/>
<htk-text lot="ticket" name="consignee"/>
</p>
<p>
<htk-text lot="ticket" name"date" format="%D"/>
<htk-text lot="ticket" name="date" format="%D"/>
</p>
<p>
<htk-text lot="ticket" name"name"/>
<htk-text lot="ticket" name="name"/>
</p>
<p>
<htk-text lot="ticket" name"zip_code"/>
<htk-text lot="ticket" name"city"/>
(<htk-text lot="ticket" name"province"/>)
<htk-text lot="ticket" name="zip_code"/>
<htk-text lot="ticket" name="city"/>
(<htk-text lot="ticket" name="province"/>)
</p>
<p>
<t>Delivery</t> <htk-text lot="ticket" name"Agencia"/>
<t>Delivery</t> <htk-text lot="ticket" name="Agencia"/>
</p>
</div>
<htk-grid>
<db-model property="model" id="movements" conn="conn" batch="batch">
<custom>
<db-model property="model" id="movements" conn="conn" lot="hash">
CALL clientTicketRowGet(#ticket)
</custom>
</db-model>
<htk-column-spin title="_Ref" name"item"/>
<htk-column-spin title="_Amount" name"amount"/>
<htk-column-text title="_Item" name"concept"/>
<htk-column-text title="_S1" name"Medida"/>
<htk-column-text title="_Cat" name"Categoria"/>
<htk-column-text title="_Color" name"Color"/>
<htk-column-spin title="_Price" name"price" unit="€" digits="2"/>
<htk-column-spin title="_Ref" name="item"/>
<htk-column-spin title="_Amount" name="amount"/>
<htk-column-text title="_Item" name="concept"/>
<htk-column-text title="_S1" name="Medida"/>
<htk-column-text title="_Cat" name="Categoria"/>
<htk-column-text title="_Color" name="Color"/>
<htk-column-spin title="_Price" name="price" unit="€" digits="2"/>
<htk-column-spin title="_Import" unit="€" digits="2" renderer="subtotalRenderer"/>
</htk-grid>
<div class="footer">
<p>
<t>Total</t>
<htk-text lot="ticket" name"total" format="%.2d€"/>
<htk-text lot="ticket" name="total" format="%.2d€"/>
</p>
<p>
<t>Total + VAT</t>
<htk-text lot="ticket" name"totalPlusVat" format="%.2d€"/>
<htk-text lot="ticket" name="totalPlusVat" format="%.2d€"/>
</p>
</div>
</div>

View File

@ -6,11 +6,9 @@
<htk-grid>
<db-model
property="model"
batch="batch"
lot="hash"
conn="conn">
<custom>
CALL item_list (#warehouse, CURDATE(), #realm, #rate)
</custom>
</db-model>
<htk-column-image
column="Foto"

View File

@ -8,20 +8,21 @@ Hedera.ShelvesReport = new Class
,trayThickness: 2
,trayMargin: 5
,activate: function (batch)
,activate: function (lot)
{
this.title = batch.getValue ('reportTitle');
this.maxAmount = batch.getValue ('maxAmount');
this.showPacking = batch.getValue ('showPacking');
this.stack = batch.getValue ('stack');
this.useIds = batch.getValue ('useIds');
this.title = lot.get ('reportTitle');
this.maxAmount = lot.get ('maxAmount');
this.showPacking = lot.get ('showPacking');
this.stack = lot.get ('stack');
this.useIds = lot.get ('useIds');
var query =
'SELECT id, name, nTrays, topTrayHeight, trayHeight, width, depth '+
'FROM shelf WHERE id = #shelf; '+
'CALL itemAllocator (#warehouse, #date, #family, #namePrefix, #useIds)';
this.conn.execQuery (query, this.onQueryExec.bind (this), this.batch);
this.conn.execQuery (query,
this.onQueryExec.bind (this), lot);
}
,onQueryExec: function (resultSet)