Version beta 2 del bionic
This commit is contained in:
parent
c7f171a71c
commit
e78a3fdd45
|
@ -0,0 +1,42 @@
|
|||
|
||||
Vn.AddressList = new Class
|
||||
({
|
||||
Extends: Vn.Module
|
||||
|
||||
,activate: function ()
|
||||
{
|
||||
this.$('user-model').setInfo ('c', 'customer_view', 'hedera');
|
||||
this.$('addresses').setInfo ('a', 'address_view', 'hedera');
|
||||
}
|
||||
|
||||
,onAddAddressClick: function ()
|
||||
{
|
||||
this.hash.set ({
|
||||
'form': 'account/address',
|
||||
'address': 0
|
||||
});
|
||||
}
|
||||
|
||||
,onReturnClick: function ()
|
||||
{
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
,onRemoveAddressClick: function (button, form)
|
||||
{
|
||||
if (confirm (_('AreYouSureDeleteAddress')))
|
||||
{
|
||||
form.set ('active', false);
|
||||
form.refresh ();
|
||||
}
|
||||
}
|
||||
|
||||
,onEditAddressClick: function (button, form)
|
||||
{
|
||||
this.hash.set ({
|
||||
'form': 'account/address',
|
||||
'address': form.get ('id')
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
.address-list
|
||||
{
|
||||
padding: 1em;
|
||||
}
|
||||
.address-list .box
|
||||
{
|
||||
max-width: 40em;
|
||||
}
|
||||
.address-list .form
|
||||
{
|
||||
margin: 0 auto;
|
||||
max-width: 25em;
|
||||
padding: 2em;
|
||||
}
|
||||
.address
|
||||
{
|
||||
color: #555;
|
||||
padding: .5em;
|
||||
}
|
||||
.address p.consignee
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
.address p
|
||||
{
|
||||
font-size: 1.4em;
|
||||
margin: 0.2em 0;
|
||||
}
|
||||
.address .actions
|
||||
{
|
||||
text-align: right;
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
<vn>
|
||||
<vn-group>
|
||||
<db-form id="user-form">
|
||||
<db-model id="user-model" updatable="true">
|
||||
SELECT user_id, default_address
|
||||
FROM customer_view c
|
||||
</db-model>
|
||||
</db-form>
|
||||
<db-model id="addresses" updatable="true">
|
||||
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
|
||||
</db-model>
|
||||
</vn-group>
|
||||
<div id="form" class="address-list">
|
||||
<div class="box">
|
||||
<div class="header">
|
||||
<h1><t>Addresses</t></h1>
|
||||
<div class="action-bar">
|
||||
<button on-click="onReturnClick">
|
||||
<img src="image/dark/go-previous.svg" alt=""/>
|
||||
<t>Return</t>
|
||||
</button>
|
||||
<button on-click="onAddAddressClick">
|
||||
<img src="image/dark/add.svg" alt=""/>
|
||||
<t>AddAddress</t>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form">
|
||||
<htk-radio-group
|
||||
id="default-address"
|
||||
column="default_address"
|
||||
form="user-form"/>
|
||||
<htk-repeater model="addresses" form-id="iter">
|
||||
<template>
|
||||
<div class="address">
|
||||
<p class="consignee">
|
||||
<htk-text form="iter" column="consignee"/>
|
||||
</p>
|
||||
<p>
|
||||
<htk-text form="iter" column="name"/>
|
||||
</p>
|
||||
<p>
|
||||
<htk-text form="iter" column="zip_code"/>,
|
||||
<htk-text form="iter" column="city"/>
|
||||
</p>
|
||||
<div class="actions">
|
||||
<htk-radio
|
||||
form="iter"
|
||||
column="id"
|
||||
radio-group="default-address"
|
||||
tip="_SetAsDefault"/>
|
||||
<htk-button
|
||||
form="iter"
|
||||
column="id"
|
||||
tip="_RemoveAddress"
|
||||
image="image/delete.svg"
|
||||
on-click="onRemoveAddressClick"/>
|
||||
<htk-button
|
||||
form="iter"
|
||||
column="id"
|
||||
tip="_EditAddress"
|
||||
image="image/edit.svg"
|
||||
on-click="onEditAddressClick"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</htk-repeater>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</vn>
|
|
@ -10,33 +10,6 @@ Vn.Conf = new Class
|
|||
this.$('addresses').setInfo ('a', 'address_view', 'hedera');
|
||||
}
|
||||
|
||||
,onUserDataReady: function (form)
|
||||
{
|
||||
this.$('user-name').value = form.get ('name');
|
||||
}
|
||||
|
||||
,onUserChange: function ()
|
||||
{
|
||||
if (!confirm (_('MustReloginIfChange')))
|
||||
return;
|
||||
|
||||
var batch = new Sql.Batch ();
|
||||
batch.addValue ('name', this.$('user-name').value);
|
||||
|
||||
var query = 'UPDATE user_view SET name = #name '
|
||||
+'WHERE id = account.user_get_id () LIMIT 1';
|
||||
|
||||
this.conn.execQuery (query, this.onUserUpdate.bind (this), batch);
|
||||
}
|
||||
|
||||
,onUserUpdate: function (resultSet)
|
||||
{
|
||||
if (!resultSet.fetchResult ())
|
||||
return;
|
||||
|
||||
location.reload ();
|
||||
}
|
||||
|
||||
,onPasswordChange: function ()
|
||||
{
|
||||
var newPassword = this.$('new-password').value;
|
||||
|
@ -77,29 +50,9 @@ Vn.Conf = new Class
|
|||
);
|
||||
}
|
||||
|
||||
,onAddAddressClick: function ()
|
||||
,onAddressesClick: function ()
|
||||
{
|
||||
this.hash.set ({
|
||||
'form': 'account/address',
|
||||
'address': 0
|
||||
});
|
||||
}
|
||||
|
||||
,onRemoveAddressClick: function (button, form)
|
||||
{
|
||||
if (confirm (_('AreYouSureDeleteAddress')))
|
||||
{
|
||||
form.set ('active', false);
|
||||
form.refresh ();
|
||||
}
|
||||
}
|
||||
|
||||
,onEditAddressClick: function (button, form)
|
||||
{
|
||||
this.hash.set ({
|
||||
'form': 'account/address',
|
||||
'address': form.get ('id')
|
||||
});
|
||||
this.hash.set ({'form': 'account/address-list'});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -32,15 +32,3 @@
|
|||
{
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
.address
|
||||
{
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.address p
|
||||
{
|
||||
margin: 0.2em 0;
|
||||
}
|
||||
.address .actions
|
||||
{
|
||||
text-align: right;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<vn>
|
||||
<vn-group>
|
||||
<db-form id="user-form" on-iter-changed="onUserDataReady">
|
||||
<db-form id="user-form">
|
||||
<db-model id="user-model" updatable="true">
|
||||
SELECT id, u.name, email, mail, c.user_id, c.default_address
|
||||
FROM user_view u
|
||||
|
@ -20,18 +20,18 @@
|
|||
<div class="box">
|
||||
<div class="header">
|
||||
<h1><t>Configuration</t></h1>
|
||||
<div class="action-bar">
|
||||
<button on-click="onAddressesClick">
|
||||
<img src="image/dark/shipping.svg" alt=""/>
|
||||
<t>Addresses</t>
|
||||
</button>
|
||||
</div>
|
||||
<div class="clear"/>
|
||||
</div>
|
||||
<div class="form">
|
||||
<div class="form-group">
|
||||
<label for="user-id"><t>UserNumber</t></label>
|
||||
<htk-text column="id" form="user-form"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user-name"><t>UserName</t></label>
|
||||
<input
|
||||
id="user-name"
|
||||
type="text"
|
||||
on-change="onUserChange"/>
|
||||
<htk-text column="name" form="user-form"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user-pass"><t>Password</t></label>
|
||||
|
@ -51,64 +51,10 @@
|
|||
<htk-entry column="email" form="user-form"></htk-entry>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="mail"><t>BillingByEmail</t></label>
|
||||
<label for="mail"><t>ReceiveInvoicesByEmail</t></label>
|
||||
<htk-check column="mail" form="user-form"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="header">
|
||||
<h1><t>Addresses</t></h1>
|
||||
<div class="action-bar">
|
||||
<button on-click="onAddAddressClick">
|
||||
<img src="image/dark/add.svg" alt=""/>
|
||||
<t>AddAddress</t>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form">
|
||||
<htk-radio-group
|
||||
id="default-address"
|
||||
column="default_address"
|
||||
form="user-form"/>
|
||||
<htk-repeater model="addresses" form-id="iter">
|
||||
<div class="address">
|
||||
<h2>
|
||||
<htk-radio
|
||||
form="iter"
|
||||
column="id"
|
||||
radio-group="default-address"
|
||||
tip="_SetAsDefault"/>
|
||||
<htk-text form="iter" column="consignee"/>
|
||||
</h2>
|
||||
<p>
|
||||
<htk-text form="iter" column="name"/>
|
||||
</p>
|
||||
<p>
|
||||
<htk-text form="iter" column="zip_code"/>,
|
||||
<htk-text form="iter" column="city"/>
|
||||
</p>
|
||||
<p>
|
||||
<htk-text form="iter" column="province"/>,
|
||||
<htk-text form="iter" column="country"/>
|
||||
</p>
|
||||
<div class="actions">
|
||||
<htk-button
|
||||
form="iter"
|
||||
column="id"
|
||||
tip="_RemoveAddress"
|
||||
image="image/delete.svg"
|
||||
on-click="onRemoveAddressClick"/>
|
||||
<htk-button
|
||||
form="iter"
|
||||
column="id"
|
||||
tip="_EditAddress"
|
||||
image="image/edit.svg"
|
||||
on-click="onEditAddressClick"/>
|
||||
</div>
|
||||
</div>
|
||||
</htk-repeater>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</vn>
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
<vn>
|
||||
<vn-group>
|
||||
<db-model id="news">
|
||||
<div id="form" class="home">
|
||||
<div class="column mansonry" id="news-column">
|
||||
<htk-repeater form-id="new">
|
||||
<db-model>
|
||||
SELECT title, date_time, text, image, id FROM news
|
||||
WHERE tag != 'course'
|
||||
ORDER BY priority, date_time DESC
|
||||
</db-model>
|
||||
</vn-group>
|
||||
<div id="form" class="home">
|
||||
<div class="column mansonry" id="news-column">
|
||||
<htk-repeater model="news" form-id="new">
|
||||
<template>
|
||||
<div class="masonry-box">
|
||||
<div class="new">
|
||||
<div class="top">
|
||||
|
@ -23,6 +22,7 @@
|
|||
<htk-image directory="news/full" form="new" column="image"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</htk-repeater>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
<vn>
|
||||
<vn-group>
|
||||
<div id="form" class="training">
|
||||
<div class="column masonry" id="news-column">
|
||||
<htk-repeater form-id="new">
|
||||
<db-model id="news">
|
||||
SELECT title, date_time, text, image, id FROM news
|
||||
WHERE tag = 'course'
|
||||
ORDER BY priority, date_time DESC
|
||||
</db-model>
|
||||
</vn-group>
|
||||
<div id="form" class="training">
|
||||
<div class="column masonry" id="news-column">
|
||||
<htk-repeater model="news" form-id="new">
|
||||
<template>
|
||||
<div class="masonry-box">
|
||||
<div class="new">
|
||||
<div class="top">
|
||||
|
@ -23,6 +22,7 @@
|
|||
<htk-image directory="news/full" form="new" column="image"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</htk-repeater>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -11,31 +11,24 @@ Vn.Catalog = new Class
|
|||
this.popup.setChildNode (this.$('lots-popup'));
|
||||
}
|
||||
|
||||
,onRealmsReload: function (model, status)
|
||||
,typeRenderer: function (builder, form)
|
||||
{
|
||||
if (status != Db.Model.Status.READY)
|
||||
return;
|
||||
|
||||
this.onRealmChange ();
|
||||
this.onTypeChange ();
|
||||
var link = builder.$('link');
|
||||
link.href = this.hash.make ({'type': form.get ('tipo_id')}, true);
|
||||
}
|
||||
|
||||
,onRealmChange: function ()
|
||||
,realmRenderer: function (builder, form)
|
||||
{
|
||||
var color;
|
||||
var realms = this.$('realms-model');
|
||||
var row = realms.search ('id', this.$('realm').value);
|
||||
var link = builder.$('link');
|
||||
link.href = this.hash.make ({
|
||||
'form': this.hash.get ('form'),
|
||||
'realm': form.get ('id')
|
||||
});
|
||||
|
||||
if (row != -1)
|
||||
this.realmColor = '#'+ realms.get (row, 'color');
|
||||
else
|
||||
this.realmColor = null;
|
||||
}
|
||||
|
||||
,onTypesReload: function (model, status)
|
||||
{
|
||||
if (status == Db.Model.Status.READY)
|
||||
this.refreshTitle ();
|
||||
var img = builder.$('image');
|
||||
img.src = 'image/family/'+ form.get ('id') +'.svg';
|
||||
img.title = form.get ('reino');
|
||||
img.alt = img.title;
|
||||
}
|
||||
|
||||
,onTypeChange: function ()
|
||||
|
@ -43,28 +36,40 @@ Vn.Catalog = new Class
|
|||
if (Vn.isMobile ())
|
||||
this.hideMenu ();
|
||||
|
||||
var realms = this.$('realms-model');
|
||||
|
||||
if (!realms.ready)
|
||||
return;
|
||||
|
||||
this.refreshTitle ();
|
||||
|
||||
var color = null;
|
||||
|
||||
if (this.$('type').value)
|
||||
color = this.realmColor;
|
||||
{
|
||||
var row = realms.search ('id', this.$('realm').value);
|
||||
|
||||
if (row != -1)
|
||||
color = '#'+ realms.get (row, 'color');
|
||||
}
|
||||
|
||||
this.$('header').style.backgroundColor = color;
|
||||
|
||||
var itemsGrid = this.$('items-grid').getNode ();
|
||||
var thead = itemsGrid.getElementsByTagName ('thead')[0];
|
||||
var tr = thead.getElementsByTagName ('tr')[0];
|
||||
var tr = this.$('items-grid').getNode ().querySelector ('thead tr');
|
||||
tr.style.backgroundColor = color;
|
||||
}
|
||||
|
||||
,refreshTitle: function (title)
|
||||
{
|
||||
var title = null;
|
||||
var types = this.$('types-model');
|
||||
|
||||
if (!types.ready)
|
||||
return;
|
||||
|
||||
var title = _('Catalog');
|
||||
|
||||
if (this.$('type').value)
|
||||
{
|
||||
var types = this.$('types-model');
|
||||
var row = types.search ('tipo_id', this.$('type').value);
|
||||
|
||||
if (row != -1)
|
||||
|
@ -73,7 +78,6 @@ Vn.Catalog = new Class
|
|||
else if (this.$('search-entry').value)
|
||||
title = _('SearchResults');
|
||||
|
||||
if (title)
|
||||
Vn.Node.setText (this.$('title'), title);
|
||||
}
|
||||
|
||||
|
@ -129,11 +133,6 @@ Vn.Catalog = new Class
|
|||
renderer.value = form.get ('Medida') +' '+ form.get ('Categoria') +' '+ form.get ('Color');
|
||||
}
|
||||
|
||||
,typeRenderer: function (column, form)
|
||||
{
|
||||
column.href = this.hash.make ({'type': form.get ('tipo_id')}, true);
|
||||
}
|
||||
|
||||
,amountRender: function (renderer, form)
|
||||
{
|
||||
var amount = form.get ('amount');
|
||||
|
@ -234,89 +233,3 @@ Vn.Catalog = new Class
|
|||
}
|
||||
});
|
||||
|
||||
Htk.Realm = new Class
|
||||
({
|
||||
Extends: Htk.Field
|
||||
,Tag: 'htk-realm'
|
||||
,Properties:
|
||||
{
|
||||
model:
|
||||
{
|
||||
type: Db.Model
|
||||
,set: function (x)
|
||||
{
|
||||
x.indexColumn ('id');
|
||||
this.link ({_model: x}, {'status-changed': this.onModelReload});
|
||||
this.onModelReload (x);
|
||||
}
|
||||
,get: function ()
|
||||
{
|
||||
return this._model;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
,_model: null
|
||||
,selectedImg: null
|
||||
|
||||
,initialize: function (props)
|
||||
{
|
||||
this.parent (props);
|
||||
this.createElement ('div');
|
||||
this.node.className = 'htk-realm';
|
||||
}
|
||||
|
||||
,onModelReload: function (model)
|
||||
{
|
||||
Vn.Node.removeChilds (this.node);
|
||||
|
||||
if (model.status != Db.Model.Status.READY)
|
||||
return;
|
||||
|
||||
var width = parseInt (100 / model.numRows) +'%';
|
||||
|
||||
for (var i = 0; i < model.numRows; i++)
|
||||
{
|
||||
var id = model.get (i, 'id');
|
||||
|
||||
var img = document.createElement ('img');
|
||||
// img.src = Vn.Config['image_dir'] +'/family/full/'+ id +'.png';
|
||||
img.src = 'image/family/'+ id +'.svg';
|
||||
img.title = model.get (i, 'reino');
|
||||
img.alt = img.title;
|
||||
img.style.width = width;
|
||||
img.style.backgroundColor = '#'+ model.get ('color');
|
||||
img.addEventListener ('click', this.clicked.bind (this, img, id));
|
||||
this.node.appendChild (img);
|
||||
|
||||
if (id == this.value)
|
||||
this.focusImage (img);
|
||||
}
|
||||
}
|
||||
|
||||
,focusImage: function (img)
|
||||
{
|
||||
if (this.selectedImg)
|
||||
this.selectedImg.className = '';
|
||||
|
||||
img.className = 'selected';
|
||||
this.selectedImg = img;
|
||||
}
|
||||
|
||||
,clicked: function (img, value)
|
||||
{
|
||||
this.focusImage (img);
|
||||
|
||||
if (value != this.value)
|
||||
this.valueChanged (value);
|
||||
}
|
||||
|
||||
,putValue: function (value)
|
||||
{
|
||||
var row = this._model.search ('id', value);
|
||||
|
||||
if (row != -1)
|
||||
this.focusImage (this.node.childNodes[row]);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ button.basket
|
|||
font-size: 1.1em;
|
||||
text-align: center;
|
||||
background-color: #00BCD4;
|
||||
box-shadow: 0 0.2em 0.2em #BBB;
|
||||
border-radius: 0;
|
||||
}
|
||||
button.basket:hover
|
||||
{
|
||||
|
@ -115,19 +115,26 @@ button.basket:hover
|
|||
|
||||
/* Realms */
|
||||
|
||||
.htk-realm
|
||||
.realms-box
|
||||
{
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
text-align: left;
|
||||
box-shadow: 0 0 0.4em #AAA;
|
||||
background-color: rgba(1, 1, 1, .1);
|
||||
}
|
||||
.htk-realm img
|
||||
.realms-box a
|
||||
{
|
||||
display: inline-block;
|
||||
line-height: 0;
|
||||
width: 33.3%;
|
||||
}
|
||||
.realms-box a > img
|
||||
{
|
||||
width: 100%;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
max-height: 4em;
|
||||
cursor: pointer;
|
||||
}
|
||||
.htk-realm img:hover
|
||||
.realms-box img:hover
|
||||
{
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
@ -137,39 +144,20 @@ button.basket:hover
|
|||
.types-box
|
||||
{
|
||||
position: absolute;
|
||||
top: 6.8em;
|
||||
top: 14.6em;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
.types
|
||||
{
|
||||
width: 100%;
|
||||
}
|
||||
.types > thead
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
.types > tbody > tr
|
||||
{
|
||||
border-top: none;
|
||||
height: 2.2em;
|
||||
}
|
||||
.types > tbody a
|
||||
.types-box a
|
||||
{
|
||||
padding: .5em 1.5em;
|
||||
display: block;
|
||||
padding: 0.3em 7%;
|
||||
width: 88%;
|
||||
height: 100%;
|
||||
}
|
||||
.types tbody a:hover
|
||||
.types-box a:hover
|
||||
{
|
||||
background-color: #EEE;
|
||||
}
|
||||
.types td.grid-message
|
||||
{
|
||||
padding-top: 1em;
|
||||
background-color: rgba(1, 1, 1, .1);
|
||||
}
|
||||
|
||||
/* Grid view */
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<vn>
|
||||
<vn-group>
|
||||
<vn-param id="realm" on-changed="onTypeChange">
|
||||
<vn-hash-link key="realm"/>
|
||||
</vn-param>
|
||||
<vn-param id="type" on-changed="onTypeChange">
|
||||
<vn-hash-link key="type"/>
|
||||
</vn-param>
|
||||
<vn-param id="search"/>
|
||||
<db-model id="realms-model" on-status-changed="onRealmsReload">
|
||||
SELECT id, reino, color FROM vn2008.reinos
|
||||
WHERE display != FALSE ORDER BY reino
|
||||
</db-model>
|
||||
<sql-filter type="AND" id="filter">
|
||||
<sql-filter-item type="EQUAL" id="sql-type">
|
||||
<sql-field name="tipo_id"/>
|
||||
|
@ -20,11 +19,17 @@
|
|||
</sql-filter>
|
||||
<db-model result-index="1" id="items-model">
|
||||
CALL bionic_from_type (@calc, #type);
|
||||
SELECT t.item_id, SUM(t.available) available, MIN(t.price) price,
|
||||
SELECT t.item_id, SUM(t.available) - IFNULL(m.amount, 0) available, MIN(t.price) price,
|
||||
a.Foto, a.Article, a.Categoria, a.Medida, a.Tallos, a.Color, o.Abreviatura
|
||||
FROM cache.bionic t
|
||||
JOIN vn2008.Articles a ON a.Id_Article = t.item_id
|
||||
LEFT JOIN vn2008.Origen o ON a.id_origen = o.id
|
||||
LEFT JOIN (
|
||||
SELECT item_id, SUM(amount) amount
|
||||
FROM basket_item
|
||||
GROUP BY item_id
|
||||
) m
|
||||
ON m.item_id = t.item_id
|
||||
WHERE t.calc_id = @calc AND t.available > 0
|
||||
GROUP BY item_id
|
||||
ORDER BY a.Article, a.Medida
|
||||
|
@ -35,8 +40,16 @@
|
|||
</db-model>
|
||||
<db-model id="item-lots" result-index="1" on-status-changed-after="onStatusChange">
|
||||
CALL bionic_from_type (@calc, #type);
|
||||
SELECT l.warehouse_id, l.items, l.grouping, l.price, l.rate, b.available
|
||||
SELECT l.warehouse_id, l.items, l.grouping, l.price, l.rate,
|
||||
t.amount, b.available - IFNULL(t.amount, 0) available
|
||||
FROM cache.bionic b
|
||||
LEFT JOIN (
|
||||
SELECT warehouse_id, SUM(amount) amount
|
||||
FROM basket_item
|
||||
WHERE item_id = #item
|
||||
GROUP BY warehouse_id
|
||||
) t
|
||||
ON t.warehouse_id = b.warehouse_id
|
||||
JOIN cache.bionic_lot l
|
||||
ON l.warehouse_id = b.warehouse_id
|
||||
AND l.item_id = b.item_id
|
||||
|
@ -97,22 +110,39 @@
|
|||
<button class="basket" on-click="onBasketClick">
|
||||
<t>ShoppingBasket</t>
|
||||
</button>
|
||||
<htk-realm id="realms" model="realms-model" on-changed="onRealmChange">
|
||||
<vn-param id="realm">
|
||||
<vn-hash-link key="realm"/>
|
||||
</vn-param>
|
||||
</htk-realm>
|
||||
<div class="types-box">
|
||||
<htk-grid class="types" empty-message="_SelectFamily">
|
||||
<db-model id="types-model" on-status-changed="onTypesReload">
|
||||
<htk-repeater
|
||||
model="realms-model"
|
||||
form-id="realm-form"
|
||||
renderer="realmRenderer"
|
||||
class="realms-box">
|
||||
<db-model id="realms-model" on-status-changed="onTypeChange">
|
||||
SELECT id, reino, color FROM vn2008.reinos
|
||||
WHERE display != FALSE ORDER BY reino
|
||||
</db-model>
|
||||
<template>
|
||||
<a id="link">
|
||||
<img id="image"/>
|
||||
</a>
|
||||
</template>
|
||||
</htk-repeater>
|
||||
<htk-repeater
|
||||
model="types-model"
|
||||
form-id="type-form"
|
||||
renderer="typeRenderer"
|
||||
empty-message="_SelectFamily"
|
||||
class="types-box">
|
||||
<db-model id="types-model" on-status-changed="refreshTitle">
|
||||
CALL type_list (#realm)
|
||||
<sql-batch property="batch">
|
||||
<item name="realm" param="realm"/>
|
||||
</sql-batch>
|
||||
</db-model>
|
||||
<htk-column-link title="_Subtype" column="Tipo" renderer="typeRenderer"/>
|
||||
</htk-grid>
|
||||
</div>
|
||||
<template>
|
||||
<a id="link">
|
||||
<htk-text form="type-form" column="Tipo"/>
|
||||
</a>
|
||||
</template>
|
||||
</htk-repeater>
|
||||
</div>
|
||||
</div>
|
||||
<div id="lots-popup" class="lots-popup">
|
||||
|
@ -141,6 +171,7 @@
|
|||
</div>
|
||||
<!--
|
||||
<htk-repeater id="grid-view" form-id="item">
|
||||
<template>
|
||||
<div class="item-box">
|
||||
<div class="image">
|
||||
<div>
|
||||
|
@ -172,6 +203,7 @@
|
|||
</p>
|
||||
<div class="clear"/>
|
||||
</div>
|
||||
</template>
|
||||
</htk-repeater>
|
||||
-->
|
||||
</vn>
|
||||
|
|
|
@ -6,6 +6,9 @@ Vn.Checkout = new Class
|
|||
,activate: function ()
|
||||
{
|
||||
this.autoStepLocked = true;
|
||||
|
||||
this.today = new Date ();
|
||||
this.today.setHours (0,0,0,0);
|
||||
}
|
||||
|
||||
,onValuesReady: function ()
|
||||
|
@ -117,9 +120,6 @@ Vn.Checkout = new Class
|
|||
_('OrderDatePickupQuestion'));
|
||||
this.$('calendar').goToSelectedMonth ();
|
||||
break;
|
||||
case 'address':
|
||||
this.$('addresses').refresh ();
|
||||
break;
|
||||
case 'agency':
|
||||
this.$('agencies').refresh ();
|
||||
break;
|
||||
|
@ -137,30 +137,44 @@ Vn.Checkout = new Class
|
|||
setTimeout (this.goNextStep.bind (this), 75);
|
||||
}
|
||||
|
||||
,addressRenderer: function (builder, index)
|
||||
{
|
||||
builder.$('address-div').addEventListener ('click',
|
||||
this.onAddressClick.bind (this, index));
|
||||
}
|
||||
|
||||
,onAddressClick: function (index)
|
||||
{
|
||||
this.$('address-form').row = index;
|
||||
this.$('address').value = this.$('address-form').get ('id');
|
||||
this.goNextStep ();
|
||||
}
|
||||
|
||||
,goNextStep: function ()
|
||||
{
|
||||
this.$('assistant').moveNext ();
|
||||
}
|
||||
|
||||
,addressRenderer: function (builder, form)
|
||||
{
|
||||
builder.$('address').addEventListener ('click',
|
||||
this.onAddressClick.bind (this, form.get ('id')));
|
||||
}
|
||||
|
||||
,onAddressClick: function (addressId)
|
||||
{
|
||||
this.$('address').value = addressId;
|
||||
this.goNextStep ();
|
||||
}
|
||||
|
||||
,onAddressChange: function ()
|
||||
{
|
||||
if (this.selectedNode)
|
||||
Vn.Node.removeClass (this.selectedNode, 'selected');
|
||||
|
||||
var row = this.$('addresses').search ('id', this.$('address').value);
|
||||
|
||||
if (row != -1)
|
||||
{
|
||||
var builder = this.$('repeater').getBuilder (row);
|
||||
|
||||
this.selectedNode = builder.$('address');
|
||||
Vn.Node.addClass (this.selectedNode, 'selected');
|
||||
}
|
||||
|
||||
this.$('address-form').row = row;
|
||||
}
|
||||
|
||||
,calendarRestrict: function (date)
|
||||
{
|
||||
var now = new Date ();
|
||||
now.setHours (0,0,0,0);
|
||||
|
||||
return date.getTime () >= now.getTime ()
|
||||
return date.getTime () >= this.today.getTime ()
|
||||
&& date.getDay () != 0;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -40,10 +40,14 @@
|
|||
border-radius: 0.1em;
|
||||
padding: 0.6em 1.4em;
|
||||
}
|
||||
.address.selected
|
||||
{
|
||||
background-color: rgba(1, 1, 1, .05);
|
||||
}
|
||||
.address:hover
|
||||
{
|
||||
cursor: pointer;
|
||||
background-color: rgba(1, 1, 1, 0.05);
|
||||
background-color: rgba(1, 1, 1, .1);
|
||||
}
|
||||
.address p.consignee
|
||||
{
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
<vn-param id="order">
|
||||
<vn-hash-link key="order"/>
|
||||
</vn-param>
|
||||
<vn-param id="date"/>
|
||||
<vn-param id="method"/>
|
||||
<vn-param id="date"/>
|
||||
<vn-param id="agency"/>
|
||||
<vn-param id="address"/>
|
||||
<vn-param id="address" on-changed="onAddressChange"/>
|
||||
<db-form id="defaults" on-ready="onValuesReady">
|
||||
<db-model>
|
||||
SELECT delivery_method, agency_id, address_id
|
||||
|
@ -103,17 +103,22 @@
|
|||
</div>
|
||||
<div id="address-step">
|
||||
<h2><t>AddressQuestion</t></h2>
|
||||
<db-form id="address-form">
|
||||
<db-model id="addresses" auto-load="false">
|
||||
<db-form id="address-form" model="addresses"/>
|
||||
<div class="answers target">
|
||||
<htk-repeater
|
||||
id="repeater"
|
||||
form-id="iter"
|
||||
on-change="onAddressChange"
|
||||
renderer="addressRenderer">
|
||||
<db-model id="addresses">
|
||||
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
|
||||
</db-model>
|
||||
</db-form>
|
||||
<htk-repeater model="addresses" form-id="iter" renderer="addressRenderer">
|
||||
<div class="answers target address" id="address-div">
|
||||
<template>
|
||||
<div class="address" id="address">
|
||||
<p class="consignee">
|
||||
<htk-text form="iter" column="consignee"/>
|
||||
</p>
|
||||
|
@ -121,8 +126,10 @@
|
|||
<htk-text form="iter" column="name"/>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</htk-repeater>
|
||||
</div>
|
||||
</div>
|
||||
<div id="agency-step">
|
||||
<h2><t>AgencyQuestion</t></h2>
|
||||
<div class="answers target">
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<div id="balance-popup" class="balance-popup">
|
||||
<htk-grid class="balance-grid" show-header="false">
|
||||
<db-model id="balance" result-index="1">
|
||||
CALL customer_debt_beta ();
|
||||
CALL customer_get_debt_by_company ();
|
||||
SELECT * FROM t_customer_debt;
|
||||
DROP TEMPORARY TABLE t_customer_debt;
|
||||
</db-model>
|
||||
|
|
|
@ -176,7 +176,7 @@ button:hover,
|
|||
input[type=submit]:hover,
|
||||
input[type=button]:hover
|
||||
{
|
||||
background-color: rgba(1, 1, 1, 0.2);
|
||||
background-color: rgba(1, 1, 1, 0.1);
|
||||
}
|
||||
|
||||
/* Flat button */
|
||||
|
@ -483,11 +483,10 @@ img.icon
|
|||
|
||||
.htk-repeater > .message
|
||||
{
|
||||
margin: 0 auto;
|
||||
width: 10em;
|
||||
padding: 1em;
|
||||
padding: 1em 0;
|
||||
text-align: center;
|
||||
}
|
||||
.htk-repeater > .message > img
|
||||
.htk-repeater > .message > *
|
||||
{
|
||||
vertical-align: middle;
|
||||
padding: 0.8em;
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="0 0 40 40"
|
||||
enable-background="new 0 0 444.488 324"
|
||||
xml:space="preserve"
|
||||
id="svg3218"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="7.svg"><metadata
|
||||
id="metadata3449"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs3447" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1016"
|
||||
id="namedview3445"
|
||||
showgrid="false"
|
||||
inkscape:zoom="20.6"
|
||||
inkscape:cx="20"
|
||||
inkscape:cy="20"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg3218"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" /><rect
|
||||
style="fill:#3f51b5;stroke-width:2.652;stroke-miterlimit:3.86369991;stroke-dasharray:none;fill-opacity:1"
|
||||
id="rect3049"
|
||||
width="40"
|
||||
height="40"
|
||||
x="0"
|
||||
y="0" /><g
|
||||
id="Background"
|
||||
transform="translate(-4.4638381,-117.67518)" /><g
|
||||
id="Guides"
|
||||
transform="translate(-4.4638381,-117.67518)" /><g
|
||||
id="g4239"
|
||||
transform="translate(-0.10053752,-2.4592427)"><path
|
||||
sodipodi:nodetypes="ccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4214"
|
||||
d="m 11.165048,20.485436 8.200434,10.498644 -2.771451,4.783696 10.604652,-0.04021 -3.727098,-7.833035 6.282246,-11.145533 z"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
|
||||
style="fill:#8ed300;stroke-width:2.65199995;stroke-miterlimit:3.86369991;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3283"
|
||||
d="M 21.454596,21.671856" /><path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:2.65199995;stroke-miterlimit:3.86369991;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3317"
|
||||
d="M 21.454596,21.671856"
|
||||
stroke-miterlimit="3.8637" /><path
|
||||
d="M 20.270658,18.367696"
|
||||
id="path3387"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#8ed300" /><path
|
||||
stroke-miterlimit="3.8637"
|
||||
d="M 20.690578,17.915555 C 24.242197,12.6377 34.259342,14.775718 31.831833,24.422882 29.239197,23.079064 24.06567,13.244664 20.690578,17.915555 Z"
|
||||
id="path3429"
|
||||
inkscape:connector-curvature="0"
|
||||
style="clip-rule:evenodd;fill:#3f51b5;fill-opacity:1;stroke:#ffffff;stroke-width:2.13580728;stroke-miterlimit:3.86369991" /><path
|
||||
style="clip-rule:evenodd;fill:#3f51b5;fill-opacity:1;stroke:#ffffff;stroke-width:2.13580728;stroke-miterlimit:3.86369991"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3437"
|
||||
d="m 20.611539,18.624687 c -2.695237,-5.762527 4.296762,-13.2467988 11.316744,-6.1978 -2.487963,1.530364 -13.582926,0.899564 -11.316744,6.1978 z"
|
||||
stroke-miterlimit="3.8637" /><g
|
||||
style="fill:#3f51b5;fill-opacity:1"
|
||||
transform="matrix(0.68482697,0,0,0.68963482,1.3118311,3.1868137)"
|
||||
id="g4195"><g
|
||||
id="g3295"
|
||||
transform="matrix(0.36363636,0,0,0.36363636,-0.08672728,-5.14738)"
|
||||
style="fill:#3f51b5;fill-opacity:1;stroke-width:7.29300022;stroke-miterlimit:3.86369991;stroke-dasharray:none"><path
|
||||
stroke-miterlimit="3.8637"
|
||||
d="m 25.409,81.75 c -1.393,-5.199 0.654,-10.508 4.746,-13.513 -0.251,-0.215 -0.496,-0.441 -0.734,-0.68 -4.955,-4.954 -4.955,-12.987 0,-17.941 3.804,-3.804 9.423,-4.688 14.07,-2.65 0.06,-0.322 0.133,-0.645 0.22,-0.966 1.813,-6.769 8.77,-10.785 15.538,-8.971 5.195,1.392 8.77,5.814 9.33,10.855 0.31,-0.109 0.626,-0.208 0.95,-0.294 6.768,-1.813 13.725,2.203 15.539,8.971 1.393,5.199 -0.654,10.509 -4.746,13.514 0.25,0.214 0.494,0.439 0.73,0.676 4.955,4.955 4.955,12.987 0,17.941 -3.8,3.8 -9.41,4.686 -14.054,2.657 -0.06,0.32 -0.133,0.642 -0.219,0.962 -1.813,6.768 -8.771,10.784 -15.539,8.971 -5.196,-1.392 -8.771,-5.816 -9.329,-10.859 -0.314,0.111 -0.635,0.211 -0.962,0.298 -6.77,1.812 -13.727,-2.204 -15.54,-8.971 z"
|
||||
id="path3297"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#3f51b5;fill-opacity:1;stroke:#ffffff;stroke-width:7.29300022;stroke-miterlimit:3.86369991;stroke-dasharray:none" /></g><g
|
||||
id="g3313"
|
||||
transform="matrix(0.36363636,0,0,0.36363636,-0.08618165,-5.146909)"
|
||||
style="fill:#3f51b5;fill-opacity:1;stroke-width:7.29300022;stroke-miterlimit:3.86369991;stroke-dasharray:none"><circle
|
||||
style="fill:#3f51b5;fill-opacity:1;stroke:#ffffff;stroke-width:7.29300022;stroke-miterlimit:3.86369991;stroke-dasharray:none"
|
||||
id="circle3315"
|
||||
r="9.2849998"
|
||||
cy="69.153999"
|
||||
cx="55.237"
|
||||
stroke-miterlimit="3.8637" /></g></g></g></svg>
|
After Width: | Height: | Size: 5.6 KiB |
|
@ -2,6 +2,7 @@ Htk.Repeater = new Class
|
|||
({
|
||||
Extends: Htk.Widget
|
||||
,Tag: 'htk-repeater'
|
||||
,Child: 'model'
|
||||
,Properties:
|
||||
{
|
||||
model:
|
||||
|
@ -67,16 +68,31 @@ Htk.Repeater = new Class
|
|||
|
||||
,loadXml: function (builder, node)
|
||||
{
|
||||
this.xml = node.firstElementChild;
|
||||
var template = node.querySelector ('template:first-of-type');
|
||||
|
||||
if (template)
|
||||
{
|
||||
this.xml = template.firstElementChild;
|
||||
this.parentBuilder = builder;
|
||||
this.onModelChange ();
|
||||
}
|
||||
}
|
||||
|
||||
,getChild: function (index)
|
||||
{
|
||||
return this.node.childNodes[index];
|
||||
}
|
||||
|
||||
,getBuilder: function (index)
|
||||
{
|
||||
return this.childsData[index].builder;
|
||||
}
|
||||
|
||||
,getForm: function (index)
|
||||
{
|
||||
return this.childsData[index].form;
|
||||
}
|
||||
|
||||
,buildBox: function (index)
|
||||
{
|
||||
var builder = new Vn.Builder ();
|
||||
|
@ -87,10 +103,15 @@ Htk.Repeater = new Class
|
|||
form.row = index;
|
||||
builder.add (this._alias, form);
|
||||
|
||||
this.childsData.push ({
|
||||
builder: builder,
|
||||
form, form
|
||||
});
|
||||
|
||||
var mainNode = builder.loadXmlFromNode (this.xml);
|
||||
|
||||
if (this._renderer)
|
||||
this._renderer (builder, index);
|
||||
this._renderer (builder, form);
|
||||
|
||||
this.node.appendChild (mainNode);
|
||||
}
|
||||
|
@ -101,6 +122,7 @@ Htk.Repeater = new Class
|
|||
return;
|
||||
|
||||
Vn.Node.removeChilds (this.node);
|
||||
this.childsData = [];
|
||||
|
||||
switch (this._model.status)
|
||||
{
|
||||
|
@ -122,6 +144,8 @@ Htk.Repeater = new Class
|
|||
this.showMessage (_('ErrorLoadingData'), 'error.svg');
|
||||
break;
|
||||
}
|
||||
|
||||
this.signalEmit ('change');
|
||||
}
|
||||
|
||||
,showNoRecordsFound: function (count)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"Addresses": "Direcciones"
|
||||
|
||||
,"Return": "Volver"
|
||||
,"AddAddress": "Añadir dirección"
|
||||
|
||||
,"SetAsDefault": "Establecer como predeterminada"
|
||||
,"RemoveAddress": "Borrar dirección"
|
||||
,"EditAddress": "Modificar dirección"
|
||||
,"AreYouSureDeleteAddress": "¿Está seguro de que desea borrar la dirección?"
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
,"Password": "Contraseña"
|
||||
,"Email": "Correo electrónico"
|
||||
,"Billing": "Facturación"
|
||||
,"BillingByEmail": "Enviar facturas por correo electrónico:"
|
||||
,"ReceiveInvoicesByEmail": "Recibir facturas por correo electrónico"
|
||||
|
||||
,"NewPassword": "Nueva contraseña"
|
||||
,"RepeatPassword": "Repetir contraseña"
|
||||
|
@ -16,10 +16,4 @@
|
|||
,"PasswordsDoesntMatch": "¡Las contraseñas no coinciden!"
|
||||
|
||||
,"Addresses": "Direcciones"
|
||||
|
||||
,"AddAddress": "Añadir dirección"
|
||||
,"SetAsDefault": "Establecer como predeterminada"
|
||||
,"RemoveAddress": "Borrar dirección"
|
||||
,"EditAddress": "Modificar dirección"
|
||||
,"AreYouSureDeleteAddress": "¿Está seguro de que desea borrar la dirección?"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue