This commit is contained in:
Juan Ferrer Toribio 2017-04-05 16:06:07 +02:00
parent efdde01e19
commit 944a955068
68 changed files with 566 additions and 814 deletions

View File

@ -11,7 +11,7 @@ Hedera.AddressList = new Class
,onAddAddressClick: function () ,onAddAddressClick: function ()
{ {
this.hash.set ({ this.hash.setAll ({
'form': 'account/address', 'form': 'account/address',
'address': 0 'address': 0
}); });

View File

@ -32,33 +32,33 @@
<div class="card list"> <div class="card list">
<htk-radio-group <htk-radio-group
id="default-address" id="default-address"
column="default_address" lot="user-form"
form="user-form"/> name="default_address"/>
<htk-repeater model="addresses" form-id="iter" renderer="repeaterFunc"> <htk-repeater model="addresses" form-id="iter" renderer="repeaterFunc">
<custom> <custom>
<a id="link" class="list-row" title="_EditAddress"> <a id="link" class="list-row" title="_EditAddress">
<div class="actions"> <div class="actions">
<htk-radio <htk-radio
form="iter" lot="iter"
column="id" name="id"
radio-group="default-address" radio-group="default-address"
tip="_SetAsDefault"/> tip="_SetAsDefault"/>
<htk-button <htk-button
form="iter" lot="iter"
column="id" name="id"
tip="_RemoveAddress" tip="_RemoveAddress"
icon="delete" icon="delete"
on-click="onRemoveAddressClick"/> on-click="onRemoveAddressClick"/>
</div> </div>
<p class="important"> <p class="important">
<htk-text form="iter" column="consignee"/> <htk-text lot="iter" name="consignee"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="name"/> <htk-text lot="iter" name="name"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="zip_code"/>, <htk-text lot="iter" name="zip_code"/>,
<htk-text form="iter" column="city"/> <htk-text lot="iter" name="city"/>
</p> </p>
</a> </a>
</custom> </custom>

View File

@ -41,28 +41,28 @@
<div class="card form"> <div class="card form">
<div> <div>
<label><t>Name</t></label> <label><t>Name</t></label>
<htk-entry form="iter" column="consignee"/> <htk-entry lot="iter" name="consignee"/>
</div> </div>
<div> <div>
<label><t>Address</t></label> <label><t>Address</t></label>
<htk-entry form="iter" column="name"/> <htk-entry lot="iter" name="name"/>
</div> </div>
<div> <div>
<label><t>City</t></label> <label><t>City</t></label>
<htk-entry form="iter" column="city"/> <htk-entry lot="iter" name="city"/>
</div> </div>
<div> <div>
<label><t>ZipCode</t></label> <label><t>ZipCode</t></label>
<htk-entry form="iter" column="zip_code"/> <htk-entry lot="iter" name="zip_code"/>
</div> </div>
<div> <div>
<label><t>Country</t></label> <label><t>Country</t></label>
<htk-combo> <htk-combo>
<db-param <vn-param
id="country" id="country"
property="param" property="param"
form="iter" lot="iter"
column="country_id" name="country_id"
one-way="true"/> one-way="true"/>
<db-model property="model"> <db-model property="model">
<custom> <custom>
@ -74,7 +74,7 @@
</div> </div>
<div> <div>
<label><t>Province</t></label> <label><t>Province</t></label>
<htk-combo form="iter" column="province_id"> <htk-combo lot="iter" name="province_id">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT province_id, name FROM vn2008.province SELECT province_id, name FROM vn2008.province

View File

@ -72,7 +72,7 @@ Hedera.Conf = new Class
,onAddressesClick: function () ,onAddressesClick: function ()
{ {
this.hash.set ({'form': 'account/address-list'}); this.hash.setAll ({'form': 'account/address-list'});
} }
}); });

View File

@ -47,15 +47,15 @@
<div class="card form"> <div class="card form">
<div> <div>
<label for="user-name"><t>Username</t></label> <label for="user-name"><t>Username</t></label>
<htk-text form="user" column="name"/> <htk-text lot="user" name="name"/>
</div> </div>
<div> <div>
<label for="email"><t>Email</t></label> <label for="email"><t>Email</t></label>
<htk-entry form="user" column="email"></htk-entry> <htk-entry lot="user" name="email"></htk-entry>
</div> </div>
<div> <div>
<label for="mail"><t>Receive invoices by email</t></label> <label for="mail"><t>Receive invoices by email</t></label>
<htk-check form="user" column="mail"/> <htk-check lot="user" name="mail"/>
</div> </div>
</div> </div>
</div> </div>
@ -97,23 +97,23 @@
</h3> </h3>
<ul> <ul>
<li> <li>
<htk-text form="password-form" column="length"/> <htk-text lot="password-form" name="length"/>
<t>characters long</t> <t>characters long</t>
</li> </li>
<li> <li>
<htk-text form="password-form" column="nAlpha"/> <htk-text lot="password-form" name="nAlpha"/>
<t>alphabetic characters</t> <t>alphabetic characters</t>
</li> </li>
<li> <li>
<htk-text form="password-form" column="nUpper"/> <htk-text lot="password-form" name="nUpper"/>
<t>capital letters</t> <t>capital letters</t>
</li> </li>
<li> <li>
<htk-text form="password-form" column="nDigits"/> <htk-text lot="password-form" name="nDigits"/>
<t>digits</t> <t>digits</t>
</li> </li>
<li> <li>
<htk-text form="password-form" column="nPunct"/> <htk-text lot="password-form" name="nPunct"/>
<t>symbols</t> <t>symbols</t>
</li> </li>
</ul> </ul>

View File

@ -22,16 +22,16 @@
<div id="main" class="access-log"> <div id="main" class="access-log">
<div class="card form"> <div class="card form">
<p> <p>
<htk-text form="user-form" column="Id_Cliente"/> <htk-text lot="user-form" name="Id_Cliente"/>
</p> </p>
<p> <p>
<htk-text form="user-form" column="Cliente"/> <htk-text lot="user-form" name="Cliente"/>
</p> </p>
<p> <p>
<htk-text form="user-form" column="Telefono"/> <htk-text lot="user-form" name="Telefono"/>
</p> </p>
<p> <p>
<htk-text form="user-form" column="movil"/> <htk-text lot="user-form" name="movil"/>
</p> </p>
</div> </div>
<div class="card"> <div class="card">
@ -56,12 +56,12 @@
<custom> <custom>
<div class="list-row"> <div class="list-row">
<p> <p>
<htk-text form="iter" column="stamp" format="_%a, %e %b %Y at %T"/> <htk-text lot="iter" name="stamp" format="_%a, %e %b %Y at %T"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="platform"/> - <htk-text lot="iter" name="platform"/> -
<htk-text form="iter" column="browser"/> <htk-text lot="iter" name="browser"/>
<htk-text form="iter" column="version"/> <htk-text lot="iter" name="version"/>
</p> </p>
</div> </div>
</custom> </custom>

View File

@ -5,7 +5,7 @@ Hedera.Connections = new Class
,_timeoutId: null ,_timeoutId: null
,onModelStatusChange: function (model, status) ,onModelStatusChange: function (model)
{ {
if (!model.ready) if (!model.ready)
return; return;
@ -40,9 +40,9 @@ Hedera.Connections = new Class
this._onUserSupplant.bind (this)); this._onUserSupplant.bind (this));
} }
,_onUserSupplant: function (userName) ,_onUserSupplant: function ()
{ {
this.hash.set ({'form': 'ecomerce/orders'}); this.hash.setAll ({'form': 'ecomerce/orders'});
} }
,sessionsFunc: function () ,sessionsFunc: function ()

View File

@ -38,23 +38,23 @@
<a id="link" class="list-row" title="_Access log"> <a id="link" class="list-row" title="_Access log">
<div class="actions"> <div class="actions">
<htk-button <htk-button
form="iter" lot="iter"
column="id" name="id"
tip="_Supplant user" tip="_Supplant user"
icon="incognito" icon="incognito"
on-click="onChangeUserClick"/> on-click="onChangeUserClick"/>
</div> </div>
<p class="important"> <p class="important">
<htk-text form="iter" column="Cliente"/> <htk-text lot="iter" name="Cliente"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="stamp" format="%a, %T"/> - <htk-text lot="iter" name="stamp" format="%a, %T"/> -
<htk-text form="iter" column="lastUpdate" format="%T"/> <htk-text lot="iter" name="lastUpdate" format="%T"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="platform"/> - <htk-text lot="iter" name="platform"/> -
<htk-text form="iter" column="browser"/> <htk-text lot="iter" name="browser"/>
<htk-text form="iter" column="version"/> <htk-text lot="iter" name="version"/>
</p> </p>
</a> </a>
</custom> </custom>

View File

@ -13,7 +13,7 @@
<div class="card form"> <div class="card form">
<div> <div>
<label><t>Store</t></label> <label><t>Store</t></label>
<htk-combo form="set" column="warehouse"> <htk-combo lot="set" name="warehouse">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT id, name FROM vn2008.warehouse SELECT id, name FROM vn2008.warehouse
@ -24,7 +24,7 @@
</div> </div>
<div> <div>
<label><t>Realm</t></label> <label><t>Realm</t></label>
<htk-combo form="set" column="realm" not-null="false"> <htk-combo lot="set" name="realm" not-null="false">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT id, reino FROM vn2008.reinos SELECT id, reino FROM vn2008.reinos

View File

@ -14,15 +14,15 @@
<custom> <custom>
<a id="link" class="list-row" target="_blank"> <a id="link" class="list-row" target="_blank">
<htk-image <htk-image
form="iter" lot="iter"
column="image" name="image"
directory="link" directory="link"
subdir="full"/> subdir="full"/>
<p class="important"> <p class="important">
<htk-text form="iter" column="name"/> <htk-text lot="iter" name="name"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="description"/> <htk-text lot="iter" name="description"/>
</p> </p>
</a> </a>
</custom> </custom>

View File

@ -11,6 +11,7 @@
,"Title": "Title" ,"Title": "Title"
,"Show packing": "Show packing" ,"Show packing": "Show packing"
,"Stack different items": "Stack different items" ,"Stack different items": "Stack different items"
,"Use ids instead of names": "Use ids instead of names"
,"Show": "Show" ,"Show": "Show"

View File

@ -11,6 +11,7 @@
,"Title": "Título" ,"Title": "Título"
,"Show packing": "Mostrar unidades por caja" ,"Show packing": "Mostrar unidades por caja"
,"Stack different items": "Apilar artículos distintos" ,"Stack different items": "Apilar artículos distintos"
,"Use ids instead of names": "Usar ids en vez de nombres"
,"Show": "Mostrar" ,"Show": "Mostrar"

View File

@ -1 +1,22 @@
{} {
"Configuration": "Configuration"
,"Select config": "Select config"
,"Reign": "Reign"
,"Family": "Family"
,"Store": "Store"
,"Date": "Date"
,"Shelf": "Shelf"
,"Name prefix": "Name prefix"
,"Limit amount per item": "Limit amount per item"
,"Title": "Title"
,"Show packing": "Show packing"
,"Stack different items": "Stack different items"
,"Use ids instead of names": "Use ids instead of names"
,"Show": "Show"
,"Pallets": "Pallets"
,"No items found, check that all fields are correct":
"No items found, check that all fields are correct"
}

View File

@ -11,6 +11,7 @@
,"Title": "Title" ,"Title": "Title"
,"Show packing": "Show packing" ,"Show packing": "Show packing"
,"Stack different items": "Stack different items" ,"Stack different items": "Stack different items"
,"Use ids instead of names": "Use ids instead of names"
,"Show": "Show" ,"Show": "Show"

View File

@ -11,6 +11,7 @@
,"Title": "Título" ,"Title": "Título"
,"Show packing": "Mostrar unidades por caixa" ,"Show packing": "Mostrar unidades por caixa"
,"Stack different items": "Empilhar ítens diferentes" ,"Stack different items": "Empilhar ítens diferentes"
,"Use ids instead of names": "Usar ids en vez de nombres"
,"Show": "Mostrar" ,"Show": "Mostrar"

View File

@ -31,11 +31,11 @@
</div> </div>
<div> <div>
<label><t>Date</t></label> <label><t>Date</t></label>
<htk-date-chooser form="set" column="date"/> <htk-date-chooser lot="set" name="date"/>
</div> </div>
<div> <div>
<label><t>Reign</t></label> <label><t>Reign</t></label>
<htk-combo form="set" column="realm" id="realm"> <htk-combo lot="set" name="realm" id="realm">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT id, reino FROM vn2008.reinos SELECT id, reino FROM vn2008.reinos
@ -46,7 +46,7 @@
</div> </div>
<div> <div>
<label><t>Family</t></label> <label><t>Family</t></label>
<htk-combo form="set" column="family"> <htk-combo lot="set" name="family">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT tipo_id, Tipo FROM vn2008.Tipos SELECT tipo_id, Tipo FROM vn2008.Tipos
@ -62,7 +62,7 @@
</div> </div>
<div> <div>
<label><t>Store</t></label> <label><t>Store</t></label>
<htk-combo form="set" column="warehouse"> <htk-combo lot="set" name="warehouse">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT id, name FROM vn2008.warehouse SELECT id, name FROM vn2008.warehouse
@ -73,7 +73,7 @@
</div> </div>
<div> <div>
<label><t>Shelf</t></label> <label><t>Shelf</t></label>
<htk-combo form="set" column="shelf"> <htk-combo lot="set" name="shelf">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT id, name FROM shelf SELECT id, name FROM shelf
@ -83,27 +83,27 @@
</div> </div>
<div> <div>
<label><t>Name prefix</t></label> <label><t>Name prefix</t></label>
<htk-entry form="set" column="namePrefix"/> <htk-entry lot="set" name="namePrefix"/>
</div> </div>
<div> <div>
<label><t>Limit amount per item</t></label> <label><t>Limit amount per item</t></label>
<htk-entry form="set" column="maxAmount"/> <htk-entry lot="set" name="maxAmount"/>
</div> </div>
<div> <div>
<label><t>Title</t></label> <label><t>Title</t></label>
<htk-entry form="set" column="reportTitle"/> <htk-entry lot="set" name="reportTitle"/>
</div> </div>
<div> <div>
<label><t>Show packing</t></label> <label><t>Show packing</t></label>
<htk-check form="set" column="showPacking"/> <htk-check lot="set" name="showPacking"/>
</div> </div>
<div> <div>
<label><t>Stack different items</t></label> <label><t>Stack different items</t></label>
<htk-check form="set" column="stack"/> <htk-check lot="set" name="stack"/>
</div> </div>
<div> <div>
<label><t>Use ids instead of names</t></label> <label><t>Use ids instead of names</t></label>
<htk-check form="set" column="useIds"/> <htk-check lot="set" name="useIds"/>
</div> </div>
</div> </div>
</div> </div>

View File

@ -33,18 +33,18 @@
<a id="link" class="list-row" title="_AccessLog"> <a id="link" class="list-row" title="_AccessLog">
<div class="actions"> <div class="actions">
<htk-button <htk-button
form="iter" lot="iter"
column="id" name="id"
tip="_AccessAsUser" tip="_AccessAsUser"
icon="incognito" icon="incognito"
on-click="onChangeUserClick"/> on-click="onChangeUserClick"/>
</div> </div>
<p class="important"> <p class="important">
<htk-text form="iter" column="Cliente"/> <htk-text lot="iter" name="Cliente"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="id"/> - <htk-text lot="iter" name="id"/> -
<htk-text form="iter" column="name"/> <htk-text lot="iter" name="name"/>
</p> </p>
</a> </a>
</custom> </custom>

View File

@ -17,9 +17,9 @@ Hedera.Users = new Class
this.onUserSupplant.bind (this)); this.onUserSupplant.bind (this));
} }
,onUserSupplant: function (userName) ,onUserSupplant: function ()
{ {
this.hash.set ({'form': 'ecomerce/orders'}); this.hash.setAll ({'form': 'ecomerce/orders'});
} }
}); });

View File

@ -72,18 +72,18 @@
<custom> <custom>
<div class="list-row"> <div class="list-row">
<p class="important"> <p class="important">
<htk-text form="iter" column="browser"/> <htk-text lot="iter" name="browser"/>
<htk-text form="iter" column="minVersion"/> - <htk-text lot="iter" name="minVersion"/> -
<htk-text form="iter" column="maxVersion"/> <htk-text lot="iter" name="maxVersion"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="visits"/> <htk-text lot="iter" name="visits"/>
<t>visits</t>, <t>visits</t>,
<htk-text form="iter" column="newVisits"/> <htk-text lot="iter" name="newVisits"/>
<t>news</t> <t>news</t>
</p> </p>
<p> <p>
<htk-text form="iter" column="lastVisit" format="_%a, %e %b %Y at %T"/> <htk-text lot="iter" name="lastVisit" format="_%a, %e %b %Y at %T"/>
</p> </p>
</div> </div>
</custom> </custom>

View File

@ -16,7 +16,7 @@ Hedera.Visits = new Class
,onSessionsClick: function () ,onSessionsClick: function ()
{ {
this.hash.set ({'form': 'admin/connections'}); this.hash.setAll ({'form': 'admin/connections'});
} }
}); });

View File

@ -5,7 +5,7 @@ Hedera.Packages = new Class
,onShowClick: function (column, agencyId) ,onShowClick: function (column, agencyId)
{ {
this.hash.set ({ this.hash.setAll ({
'form': 'agencies/provinces', 'form': 'agencies/provinces',
'agency': agencyId 'agency': agencyId
}); });

View File

@ -5,7 +5,7 @@ Hedera.Home = new Class
,onStartOrderClick: function () ,onStartOrderClick: function ()
{ {
this.hash.set ({'form': 'ecomerce/catalog'}); this.hash.setAll ({'form': 'ecomerce/catalog'});
} }
}); });

View File

@ -22,21 +22,21 @@
<div class="masonry-box"> <div class="masonry-box">
<div class="new"> <div class="new">
<div class="top"> <div class="top">
<h2><htk-text form="new" column="title"/></h2> <h2><htk-text lot="new" name="title"/></h2>
<!-- <!--
<p class="new-info"> <p class="new-info">
<htk-text format="_%a, %e %b %Y" form="new" column="date_time"/> <htk-text format="_%a, %e %b %Y" lot="new" name="date_time"/>
</p> </p>
--> -->
<div class="new-text"> <div class="new-text">
<htk-html form="new" column="text"/> <htk-html lot="new" name="text"/>
</div> </div>
</div> </div>
<htk-image <htk-image
directory="news" directory="news"
subdir="full" subdir="full"
form="new" lot="new"
column="image" name="image"
editable="false" editable="false"
full-dir="full"/> full-dir="full"/>
</div> </div>

View File

@ -16,19 +16,19 @@
<div class="masonry-box"> <div class="masonry-box">
<div class="new"> <div class="new">
<div class="top"> <div class="top">
<h2><htk-text form="new" column="title"/></h2> <h2><htk-text lot="new" name="title"/></h2>
<p class="new-info"> <p class="new-info">
<htk-text format="_%a, %e %b %Y" form="new" column="date_time"/> <htk-text format="_%a, %e %b %Y" lot="new" name="date_time"/>
</p> </p>
<div class="new-text"> <div class="new-text">
<htk-html form="new" column="text"/> <htk-html lot="new" name="text"/>
</div> </div>
</div> </div>
<htk-image <htk-image
directory="news" directory="news"
subdir="full" subdir="full"
form="new" lot="new"
column="image" name="image"
editable="false" editable="false"
full-dir="full"/> full-dir="full"/>
</div> </div>

View File

@ -8,7 +8,7 @@ Hedera.Basket = new Class
this.close (); this.close ();
this.isOpen = true; this.isOpen = true;
Hedera.BasketChecker.check (this.conn, Hedera.BasketChecker.check (this.conn, this.hash,
this.onBasketCheck.bind (this)); this.onBasketCheck.bind (this));
} }
@ -26,17 +26,17 @@ Hedera.Basket = new Class
,onConfigureClick: function () ,onConfigureClick: function ()
{ {
Htk.Toast.showWarning (_('RememberReconfiguringImpact')); Htk.Toast.showWarning (_('RememberReconfiguringImpact'));
this.hash.set ({'form': 'ecomerce/checkout'}); this.hash.setAll ({'form': 'ecomerce/checkout'});
} }
,onCatalogClick: function () ,onCatalogClick: function ()
{ {
this.hash.set ({'form': 'ecomerce/catalog'}); this.hash.setAll ({'form': 'ecomerce/catalog'});
} }
,onCheckoutClick: function () ,onCheckoutClick: function ()
{ {
this.hash.set ({'form': 'ecomerce/confirm'}); this.hash.setAll ({'form': 'ecomerce/confirm'});
} }
,repeaterFunc: function (res, form) ,repeaterFunc: function (res, form)

View File

@ -39,27 +39,27 @@
<custom> <custom>
<div class="line"> <div class="line">
<htk-button <htk-button
form="iter" lot="iter"
column="ticket_id" name="ticket_id"
class="delete" class="delete"
tip="_Remove" tip="_Remove"
icon="delete" icon="delete"
on-click="onDeleteClick"/> on-click="onDeleteClick"/>
<htk-image <htk-image
form="iter" lot="iter"
column="Foto" name="Foto"
class="photo" class="photo"
directory="catalog" directory="catalog"
subdir="200x200" subdir="200x200"
full-dir="900x900"/> full-dir="900x900"/>
<p class="concept"> <p class="concept">
<htk-text form="iter" column="Article"/> <htk-text lot="iter" name="Article"/>
<htk-text form="iter" column="Medida"/> <htk-text lot="iter" name="Medida"/>
<htk-text form="iter" column="Categoria"/> <htk-text lot="iter" name="Categoria"/>
</p> </p>
<p class="amount"> <p class="amount">
<htk-text form="iter" column="amount"/> x <htk-text lot="iter" name="amount"/> x
<htk-text form="iter" column="price" format="%.2d€"/> <htk-text lot="iter" name="price" format="%.2d€"/>
<span class="subtotal"> <span class="subtotal">
<htk-text id="subtotal" format="%.2d€"/> <htk-text id="subtotal" format="%.2d€"/>
</span> </span>

View File

@ -12,7 +12,7 @@ Hedera.Catalog = new Class
if (!localStorage.getItem ('hederaGuest')) if (!localStorage.getItem ('hederaGuest'))
{ {
Hedera.BasketChecker.check (this.conn, Hedera.BasketChecker.check (this.conn, this.hash,
this.onBasketCheck.bind (this)); this.onBasketCheck.bind (this));
} }
else else
@ -251,7 +251,7 @@ Hedera.Catalog = new Class
if (this.isGuest ()) if (this.isGuest ())
return; return;
this.hash.set ({'form': 'ecomerce/basket'}); this.hash.setAll ({'form': 'ecomerce/basket'});
} }
,onConfigureClick: function () ,onConfigureClick: function ()
@ -259,7 +259,7 @@ Hedera.Catalog = new Class
if (this.isGuest ()) if (this.isGuest ())
return; return;
this.hash.set ({'form': 'ecomerce/checkout'}); this.hash.setAll ({'form': 'ecomerce/checkout'});
} }
,onAddItemClick: function (button, form) ,onAddItemClick: function (button, form)

View File

@ -151,38 +151,38 @@
<htk-image <htk-image
directory="catalog" directory="catalog"
subdir="200x200" subdir="200x200"
form="item" lot="item"
column="Foto" name="Foto"
full-dir="900x900"/> full-dir="900x900"/>
<div class="item-info"> <div class="item-info">
<htk-button <htk-button
form="item" lot="item"
column="id" name="id"
tip="_AddToBasket" tip="_AddToBasket"
icon="add" icon="add"
on-click="onAddItemClick" on-click="onAddItemClick"
class="add-button"/> class="add-button"/>
<h2> <h2>
<htk-text form="item" column="Article"/> <htk-text lot="item" name="Article"/>
</h2> </h2>
<p class="producer"> <p class="producer">
<htk-text form="item" column="producer"/> <htk-text lot="item" name="producer"/>
</p> </p>
<p> <p>
<t>Size</t> <htk-text form="item" column="Medida"/>, <t>Size</t> <htk-text lot="item" name="Medida"/>,
<t>Category</t> <htk-text form="item" column="Categoria"/> <t>Category</t> <htk-text lot="item" name="Categoria"/>
</p> </p>
<p class="color"> <p class="color">
<t>Color</t> <htk-text form="item" column="color"/> <t>Color</t> <htk-text lot="item" name="color"/>
<htk-text form="item" column="Tallos" format="_, %.0d Units"/> <htk-text lot="item" name="Tallos" format="_, %.0d Units"/>
</p> </p>
<div class="aval-price"> <div class="aval-price">
<htk-text form="item" column="available"/> <htk-text lot="item" name="available"/>
<span class="from"> <span class="from">
<t>from</t> <t>from</t>
</span> </span>
<span class="price"> <span class="price">
<htk-text form="item" column="price" format="%.2d€"/> <htk-text lot="item" name="price" format="%.2d€"/>
</span> </span>
</div> </div>
</div> </div>
@ -194,11 +194,11 @@
<div id="right-panel" class="right-panel" on-click="onRightPanelClick"> <div id="right-panel" class="right-panel" on-click="onRightPanelClick">
<div class="basket-info"> <div class="basket-info">
<p> <p>
<htk-text form="basket" column="date_send" format="%D"/> <htk-text lot="basket" name="date_send" format="%D"/>
</p> </p>
<p> <p>
<span id="method"/> <span id="method"/>
<htk-text form="basket" column="agency"/> <htk-text lot="basket" name="agency"/>
</p> </p>
<button class="thin" on-click="onConfigureClick"> <button class="thin" on-click="onConfigureClick">
<t>Change</t> <t>Change</t>
@ -415,32 +415,32 @@
<htk-image <htk-image
directory="catalog" directory="catalog"
subdir="200x200" subdir="200x200"
form="card" lot="card"
column="Foto" name="Foto"
full-dir="900x900" full-dir="900x900"
conn="conn" conn="conn"
editable="true"/> editable="true"/>
<div class="item-info"> <div class="item-info">
<h2> <h2>
<htk-text form="card" column="Article"/> <htk-text lot="card" name="Article"/>
</h2> </h2>
<p class="producer"> <p class="producer">
<htk-text form="card" column="producer"/> <htk-text lot="card" name="producer"/>
</p> </p>
<p> <p>
<t>Size</t> <htk-text form="card" column="Medida"/>, <t>Size</t> <htk-text lot="card" name="Medida"/>,
<t>Category</t> <htk-text form="card" column="Categoria"/> <t>Category</t> <htk-text lot="card" name="Categoria"/>
</p> </p>
<p class="color"> <p class="color">
<t>Color</t> <htk-text form="card" column="color"/> <t>Color</t> <htk-text lot="card" name="color"/>
<htk-text form="card" column="Tallos" format="_, %.0d Units"/> <htk-text lot="card" name"Tallos" format="_, %.0d Units"/>
</p> </p>
<p> <p>
<t>Origin</t> <htk-text form="card-extend" column="origin"/> <t>Origin</t> <htk-text lot="card-extend" name"origin"/>
</p> </p>
</div> </div>
<p class="desc"> <p class="desc">
<htk-text form="card-extend" column="description" id="desc"/> <htk-text lot="card-extend" name"description" id="desc"/>
</p> </p>
</div> </div>
<htk-grid class="lots-grid" model="item-lots" show-header="false"> <htk-grid class="lots-grid" model="item-lots" show-header="false">

View File

@ -34,7 +34,9 @@ Hedera.Checkout = new Class
date = new Date (); date = new Date ();
if (i.get('delivery_method') != 'PICKUP') if (i.get('delivery_method') != 'PICKUP')
date.setTime (date.getTime () + 86400000); date.setDate (date.getDate () + 1);
date.setHours (0, 0, 0, 0);
} }
this.$('date').value = date; this.$('date').value = date;
@ -80,7 +82,7 @@ Hedera.Checkout = new Class
else else
Htk.Toast.showMessage (_('OrderStarted')); Htk.Toast.showMessage (_('OrderStarted'));
this.hash.set ({'form': 'ecomerce/catalog'}); this.hash.setAll ({'form': 'ecomerce/catalog'});
} }
,onCancelClick: function () ,onCancelClick: function ()
@ -88,7 +90,7 @@ Hedera.Checkout = new Class
if (this.$('order-form').numRows > 0) if (this.$('order-form').numRows > 0)
window.history.back(); window.history.back();
else else
this.hash.set ({'form': 'ecomerce/orders'}); this.hash.setAll ({'form': 'ecomerce/orders'});
} }
,agencySteps: ['method', 'date', 'address', 'agency', 'confirm-agency'] ,agencySteps: ['method', 'date', 'address', 'agency', 'confirm-agency']

View File

@ -114,10 +114,10 @@
<custom> <custom>
<div class="address" id="address"> <div class="address" id="address">
<p class="consignee"> <p class="consignee">
<htk-text form="iter" column="consignee"/> <htk-text lot="iter" name"consignee"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="name"/> <htk-text lot="iter" name"name"/>
</p> </p>
</div> </div>
</custom> </custom>
@ -152,11 +152,11 @@
<htk-text format="%D" param="date"/> <htk-text format="%D" param="date"/>
</p> </p>
<p> <p>
<htk-text form="address-form" column="name"/> <htk-text lot="address-form" name"name"/>
</p> </p>
<p> <p>
<t>Agency</t> <t>Agency</t>
<htk-text form="agency-combo" column="description"/> <htk-text lot="agency-combo" name"description"/>
</p> </p>
<button id="confirm-agency" class="thin" on-click="onConfirmClick"> <button id="confirm-agency" class="thin" on-click="onConfirmClick">
<t>Confirm</t> <t>Confirm</t>
@ -172,7 +172,7 @@
<htk-text format="%D" param="date"/> <htk-text format="%D" param="date"/>
</p> </p>
<p> <p>
<htk-text form="address-form" column="name"/> <htk-text lot="address-form" name"name"/>
</p> </p>
<p> <p>
<t>ReceiveThroughtRoute</t> <t>ReceiveThroughtRoute</t>
@ -192,7 +192,7 @@
</p> </p>
<p> <p>
<t>Warehouse</t> <t>Warehouse</t>
<htk-text form="warehouse-combo" column="description"/> <htk-text lot="warehouse-combo" name"description"/>
</p> </p>
<button id="confirm-pickup" class="thin" on-click="onConfirmClick"> <button id="confirm-pickup" class="thin" on-click="onConfirmClick">
<t>Confirm</t> <t>Confirm</t>

View File

@ -8,7 +8,7 @@ Hedera.Confirm = new Class
this.close (); this.close ();
this.isOpen = true; this.isOpen = true;
Hedera.BasketChecker.check (this.conn, Hedera.BasketChecker.check (this.conn, this.hash,
this.onBasketCheck.bind (this)); this.onBasketCheck.bind (this));
} }
@ -164,11 +164,14 @@ Hedera.Confirm = new Class
else else
var payAmount = this.$('total-amount').value; var payAmount = this.$('total-amount').value;
var tpv = new Hedera.Tpv ({conn: this.conn}); var tpv = new Hedera.Tpv ({
conn: this.conn,
hash: this.hash
});
tpv.pay (payAmount, this.$('order-form').get ('company_id')); tpv.pay (payAmount, this.$('order-form').get ('company_id'));
} }
else else
this.hash.set ({'form': 'ecomerce/orders'}); this.hash.setAll ({'form': 'ecomerce/orders'});
} }
}); });

View File

@ -38,23 +38,23 @@
<div class="delivery"> <div class="delivery">
<p> <p>
<t>Delivery at</t> <t>Delivery at</t>
<htk-text format="%D" form="order-form" column="date_send"/> <htk-text format="%D" lot="order-form" name"date_send"/>
</p> </p>
<p> <p>
<span id="method"><t>Agency</t></span> <span id="method"><t>Agency</t></span>
<htk-text form="order-form" column="agency"/> <htk-text lot="order-form" name"agency"/>
</p> </p>
</div> </div>
<div id="address" class="address"> <div id="address" class="address">
<p> <p>
<htk-text form="order-form" column="consignee"/> <htk-text lot="order-form" name"consignee"/>
</p> </p>
<p> <p>
<htk-text form="order-form" column="address"/> <htk-text lot="order-form" name"address"/>
</p> </p>
<p> <p>
<htk-text form="order-form" column="zip_code"/>, <htk-text lot="order-form" name"zip_code"/>,
<htk-text form="order-form" column="city"/> <htk-text lot="order-form" name"city"/>
</p> </p>
</div> </div>
</div> </div>
@ -76,7 +76,7 @@
<t>Order total</t> <t>Order total</t>
</td> </td>
<td class="currency"> <td class="currency">
<htk-text format="%.2d€" form="order-form" column="tax_base"/> <htk-text format="%.2d€" lot="order-form" name"tax_base"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -84,7 +84,7 @@
<t>Order VAT</t> <t>Order VAT</t>
</td> </td>
<td class="currency"> <td class="currency">
<htk-text format="%.2d€" form="order-form" column="vat"/> <htk-text format="%.2d€" lot="order-form" name"vat"/>
</td> </td>
</tr> </tr>
<tr class="total-debt sum-total"> <tr class="total-debt sum-total">
@ -100,7 +100,7 @@
<t>Credit</t> <t>Credit</t>
</td> </td>
<td class="currency"> <td class="currency">
<htk-text format="%.2d€" form="order-form" column="credit"/> <htk-text format="%.2d€" lot="order-form" name"credit"/>
</td> </td>
</tr> </tr>
<tr id="exceeded-info" class="exceeded-info sum-total"> <tr id="exceeded-info" class="exceeded-info sum-total">
@ -181,14 +181,14 @@
<custom> <custom>
<div class="transfer-account"> <div class="transfer-account">
<p> <p>
<htk-text form="iter" column="description"/> <htk-text lot="iter" name"description"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="iban"/> <htk-text lot="iter" name"iban"/>
<htk-text form="iter" column="entity_id"/> <htk-text lot="iter" name"entity_id"/>
<htk-text form="iter" column="office"/> <htk-text lot="iter" name"office"/>
<htk-text form="iter" column="dc"/> <htk-text lot="iter" name"dc"/>
<htk-text form="iter" column="number"/> <htk-text lot="iter" name"number"/>
</p> </p>
</div> </div>
</custom> </custom>

View File

@ -5,13 +5,16 @@ Hedera.Orders = new Class
,activate: function () ,activate: function ()
{ {
this.tpv = new Hedera.Tpv ({conn: this.conn}); this.tpv = new Hedera.Tpv ({
conn: this.conn,
hash: this.hash
});
this.tpv.check (this._onTpvCheck.bind (this)); this.tpv.check (this._onTpvCheck.bind (this));
if (!this.$('from').value) if (!this.$('from').value)
{ {
var from = new Date (); var from = new Date ();
from.setDate (from.getDate () - 25); from.setDate (from.getDate () - 30);
from.setHours (0, 0, 0, 0); from.setHours (0, 0, 0, 0);
this.$('from').value = from; this.$('from').value = from;
} }
@ -25,7 +28,7 @@ Hedera.Orders = new Class
,onBasketClick: function () ,onBasketClick: function ()
{ {
this.hash.set ({'form': 'ecomerce/basket'}); this.hash.setAll ({'form': 'ecomerce/basket'});
} }
,repeaterFunc: function (res, form) ,repeaterFunc: function (res, form)

View File

@ -30,7 +30,7 @@
<t>Balance:</t> <t>Balance:</t>
</span> </span>
<span class="amount" id="balance"> <span class="amount" id="balance">
<htk-text form="debt" column="debt" format="%.2d€"/> <htk-text lot="debt" name"debt" format="%.2d€"/>
</span> </span>
<img <img
src="image/icon/dark/info.svg" src="image/icon/dark/info.svg"
@ -61,19 +61,19 @@
<custom> <custom>
<a id="link" class="list-row" title="_SeeOrder"> <a id="link" class="list-row" title="_SeeOrder">
<p class="important total"> <p class="important total">
<htk-text form="iter" column="total" format="%.2d€"/> <htk-text lot="iter" name"total" format="%.2d€"/>
</p> </p>
<p class="important"> <p class="important">
<htk-text form="iter" column="date" format="%D"/> <htk-text lot="iter" name"date" format="%D"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="consignee"/> <htk-text lot="iter" name"consignee"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="type"/> <htk-text lot="iter" name"type"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="ticket_id"/> <htk-text lot="iter" name"ticket_id"/>
</p> </p>
</a> </a>
</custom> </custom>

View File

@ -29,36 +29,36 @@
<div class="head"> <div class="head">
<div> <div>
<p class="important ticket-id"> <p class="important ticket-id">
<htk-text column="id" form="ticket"/> <htk-text name"id" lot="ticket"/>
</p> </p>
<p> <p>
<htk-text form="ticket" column="delivery" format="%D"/> <htk-text lot="ticket" name"delivery" format="%D"/>
</p> </p>
</div> </div>
<div> <div>
<p> <p>
<t>Delivery</t> <htk-text form="ticket" column="Agencia"/> <t>Delivery</t> <htk-text lot="ticket" name"Agencia"/>
</p> </p>
<p> <p>
<htk-text form="ticket" column="consignee"/> <htk-text lot="ticket" name"consignee"/>
</p> </p>
<p> <p>
<htk-text form="ticket" column="name"/> <htk-text lot="ticket" name"name"/>
</p> </p>
<p> <p>
<htk-text form="ticket" column="zip_code"/> <htk-text lot="ticket" name"zip_code"/>
<htk-text form="ticket" column="city"/> <htk-text lot="ticket" name"city"/>
(<htk-text form="ticket" column="province"/>) (<htk-text lot="ticket" name"province"/>)
</p> </p>
</div> </div>
<div> <div>
<p class="important total"> <p class="important total">
<t>Total</t> <t>Total</t>
<htk-text form="ticket" column="total" format="%.2d€"/> <htk-text lot="ticket" name"total" format="%.2d€"/>
</p> </p>
<p class="important total"> <p class="important total">
<t>Total + VAT</t> <t>Total + VAT</t>
<htk-text form="ticket" column="totalPlusVat" format="%.2d€"/> <htk-text lot="ticket" name"totalPlusVat" format="%.2d€"/>
</p> </p>
</div> </div>
</div> </div>
@ -76,20 +76,20 @@
<custom> <custom>
<div class="line"> <div class="line">
<htk-image <htk-image
form="iter" lot="iter"
column="Foto" name"Foto"
class="photo" class="photo"
directory="catalog" directory="catalog"
subdir="200x200" subdir="200x200"
full-dir="900x900"/> full-dir="900x900"/>
<p class="concept"> <p class="concept">
<htk-text form="iter" column="concept"/> <htk-text lot="iter" name"concept"/>
<htk-text form="iter" column="Medida"/> <htk-text lot="iter" name"Medida"/>
<htk-text form="iter" column="Categoria"/> <htk-text lot="iter" name"Categoria"/>
</p> </p>
<p class="amount"> <p class="amount">
<htk-text form="iter" column="amount"/> x <htk-text lot="iter" name"amount"/> x
<htk-text form="iter" column="price" format="%.2d€"/> <htk-text lot="iter" name"price" format="%.2d€"/>
<span class="subtotal"> <span class="subtotal">
<htk-text id="subtotal" format="%.2d€"/> <htk-text id="subtotal" format="%.2d€"/>
</span> </span>

View File

@ -86,7 +86,7 @@ Hedera.New = new Class
,onReturnClick: function () ,onReturnClick: function ()
{ {
this.hash.set ({'form': 'news/news'}); this.hash.setAll ({'form': 'news/news'});
} }
}); });

View File

@ -19,7 +19,7 @@
</sql-batch> </sql-batch>
</db-model> </db-model>
</db-form> </db-form>
<db-param form="iter" column="text" on-changed="onBodyChange"/> <vn-param lot="iter" name"text" on-changed="onBodyChange"/>
</vn-group> </vn-group>
<h1 id="title"> <h1 id="title">
<t>AddEditNew</t> <t>AddEditNew</t>
@ -38,11 +38,11 @@
<div class="card form"> <div class="card form">
<div> <div>
<label><t>Title</t></label> <label><t>Title</t></label>
<htk-entry form="iter" column="title"/> <htk-entry lot="iter" name"title"/>
</div> </div>
<div> <div>
<label><t>Tag</t></label> <label><t>Tag</t></label>
<htk-combo form="iter" column="tag"> <htk-combo lot="iter" name"tag">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT name, description FROM news_tag SELECT name, description FROM news_tag

View File

@ -19,7 +19,7 @@ Hedera.News = new Class
,onAddClick: function () ,onAddClick: function ()
{ {
this.hash.set ({ this.hash.setAll ({
'form': 'news/new', 'form': 'news/new',
'new': 0 'new': 0
}); });

View File

@ -23,15 +23,15 @@
<a id="link" class="list-row" title="_EditNew"> <a id="link" class="list-row" title="_EditNew">
<div class="actions"> <div class="actions">
<htk-button <htk-button
form="iter" lot="iter"
column="id" name"id"
tip="_Remove" tip="_Remove"
icon="delete" icon="delete"
on-click="onDeleteClick"/> on-click="onDeleteClick"/>
</div> </div>
<htk-image <htk-image
form="iter" lot="iter"
column="image" name"image"
class="photo" class="photo"
directory="news" directory="news"
subdir="200x200" subdir="200x200"
@ -39,14 +39,14 @@
editable="true" editable="true"
conn="conn"/> conn="conn"/>
<p class="important"> <p class="important">
<htk-text form="iter" column="title"/> <htk-text lot="iter" name"title"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="Cliente"/> <htk-text lot="iter" name"Cliente"/>
</p> </p>
<p> <p>
<t>Priority</t> <t>Priority</t>
<htk-text form="iter" column="priority"/> <htk-text lot="iter" name"priority"/>
</p> </p>
</a> </a>
</custom> </custom>

View File

@ -5,7 +5,7 @@ Hedera.Preview = new Class
,activate: function () ,activate: function ()
{ {
var reportName = Vn.Hash.get ('report'); var reportName = this.hash.get ('report');
if (!reportName) if (!reportName)
{ {
@ -35,14 +35,11 @@ Hedera.Preview = new Class
return; return;
} }
var batch = new Sql.Batch ();
batch.addValues (Vn.Hash._hashMap);
this.report = new module.klass ({ this.report = new module.klass ({
info: module, info: module,
conn: this.conn conn: this.conn
}); });
this.report.open (batch, this.node); this.report.open (this.hash, this.node);
} }
,onPrintClick: function () ,onPrintClick: function ()

View File

@ -56,11 +56,11 @@ Connection.implement
* *
* @param {Sql.Stmt} stmt The statement * @param {Sql.Stmt} stmt The statement
* @param {Function} callback The function to call when operation is done * @param {Function} callback The function to call when operation is done
* @param {Sql.Batch} batch The batch used to set the parameters * @param {Object} params The statement parameters
*/ */
,execStmt: function (stmt, callback, batch) ,execStmt: function (stmt, callback, params)
{ {
this.execSql (stmt.render (batch), callback); this.execSql (stmt.render (params), callback);
} }
/** /**
@ -68,11 +68,11 @@ Connection.implement
* *
* @param {String} query The SQL statement * @param {String} query The SQL statement
* @param {Function} callback The function to call when operation is done * @param {Function} callback The function to call when operation is done
* @param {Sql.Batch} batch The batch used to set the parameters * @param {Object} params The statement parameters
*/ */
,execQuery: function (query, callback, batch) ,execQuery: function (query, callback, params)
{ {
this.execStmt (new Sql.String ({query: query}), callback, batch); this.execStmt (new Sql.String ({query: query}), callback, params);
} }
/* /*

View File

@ -9,7 +9,6 @@ Db = module.exports = {
,Iterator : require ('./iterator') ,Iterator : require ('./iterator')
,SimpleIterator : require ('./simple-iterator') ,SimpleIterator : require ('./simple-iterator')
,Form : require ('./form') ,Form : require ('./form')
,Param : require ('./param')
,Query : require ('./query') ,Query : require ('./query')
,Calc : require ('./calc') ,Calc : require ('./calc')
,CalcSum : require ('./calc-sum') ,CalcSum : require ('./calc-sum')

View File

@ -101,6 +101,22 @@ Model.implement
return this._batch; return this._batch;
} }
}, },
/**
* The lot used to execute the statement.
*/
lot:
{
type: Vn.Lot
,set: function (x)
{
this.link ({_lot: x}, {'change': this._autoLoad});
this._autoLoad ();
}
,get: function ()
{
return this._lot;
}
},
/** /**
* The model select statement. * The model select statement.
*/ */

View File

@ -1,97 +0,0 @@
var Form = require ('./form');
module.exports = new Class
({
Extends: Vn.Param
,Tag: 'db-param'
,Parent: 'form'
,Properties:
{
/**
* The form field referenced by this param.
*/
column:
{
type: String
,set: function (x)
{
this._columnName = x;
this.refresh ();
}
,get: function ()
{
this._columnName;
}
},
/**
* The form referenced by this param.
*/
form:
{
type: Form
,set: function (x)
{
this.link ({_set: x},
{
'change': this.onSetChange
});
this.refresh ();
}
,get: function ()
{
return this._set;
}
},
/**
* Determines whether the link to the form is unidirectional, ie, a
* change in the form updates the parameter but not vice versa.
*/
oneWay:
{
type: Boolean
,set: function (x)
{
this._oneWay = x;
}
,get: function ()
{
return this._oneWay;
}
}
}
,_columnName: null
,_set: null
,_setLock: false
,_oneWay: false
,_setValue: null
,initialize: function (props)
{
this.parent (props);
this.on ('changed', this.onChange, this);
}
,refresh: function ()
{
if (this._set)
this.onSetChange ();
}
,onSetChange: function ()
{
this._setLock = true;
var formValue = this._set.get (this._columnName);
this.value = formValue;
this._setLock = false;
}
,onChange: function ()
{
if (!this._setLock && this._columnName && !this.oneWay)
this._set.set (this._columnName, this._value);
}
});

View File

@ -56,19 +56,19 @@ module.exports = new Class
} }
}, },
/** /**
* The batch used to execute the statement. * The lot used to execute the statement.
*/ */
batch: lot:
{ {
type: Sql.Batch type: Vn.Lot
,set: function (x) ,set: function (x)
{ {
this.link ({_batch: x}, {'changed': this.onChange}); this.link ({_lot: x}, {'change': this.onChange});
this.onChange (); this._autoLoad ();
} }
,get: function () ,get: function ()
{ {
return this._batch; return this._lot;
} }
}, },
/** /**
@ -81,11 +81,6 @@ module.exports = new Class
} }
} }
,initialize: function (props)
{
this.parent (props);
}
,loadXml: function (builder, node) ,loadXml: function (builder, node)
{ {
this.parent (builder, node); this.parent (builder, node);

View File

@ -21,7 +21,7 @@ module.exports = new Class
{ {
window.onerror = this._onWindowError.bind (this); window.onerror = this._onWindowError.bind (this);
window.onunload = this._onWindowUnload.bind (this); window.onunload = this._onWindowUnload.bind (this);
Vn.Hash.initialize (); this._hash = new Vn.Hash ({window: window});
var conn = new Db.Connection (); var conn = new Db.Connection ();
this.link ({_conn: conn}, {'error': this._onConnError}); this.link ({_conn: conn}, {'error': this._onConnError});
@ -34,7 +34,10 @@ module.exports = new Class
if (this.tryAutoLogin ()) if (this.tryAutoLogin ())
return; return;
var login = this._login = new Login ({conn: this._conn}); var login = this._login = new Login ({
conn: this._conn,
hash: this._hash
});
login.on ('login', this._onLogin, this); login.on ('login', this._onLogin, this);
login.show (); login.show ();
} }
@ -43,7 +46,10 @@ module.exports = new Class
{ {
this._freeLogin (); this._freeLogin ();
var gui = this._gui = new Gui ({conn: this._conn}); var gui = this._gui = new Gui ({
conn: this._conn,
hash: this._hash
});
gui.on ('logout', this._onLogout, this); gui.on ('logout', this._onLogout, this);
gui.show (); gui.show ();
} }
@ -82,7 +88,7 @@ module.exports = new Class
this._logout (); this._logout ();
break; break;
case 'OutdatedVersion': case 'OutdatedVersion':
this._newVersion (error); this._newVersion ();
break; break;
default: default:
Htk.Toast.showError (error.message); Htk.Toast.showError (error.message);
@ -100,7 +106,7 @@ module.exports = new Class
this._gui.logout (); this._gui.logout ();
} }
,_newVersion: function (error) ,_newVersion: function ()
{ {
if (this.ignoreVersion) if (this.ignoreVersion)
return; return;
@ -162,6 +168,7 @@ module.exports = new Class
this._freeGui (); this._freeGui ();
this.deinitAutoLogin (); this.deinitAutoLogin ();
this._conn.unref (); this._conn.unref ();
this._hash.unref ();
} }
// Auto login functionality // Auto login functionality
@ -170,15 +177,17 @@ module.exports = new Class
,initAutoLogin: function () ,initAutoLogin: function ()
{ {
var isGuest = new Vn.HashParam var isGuest = new Vn.Param
({ ({
lot: this._hash,
type: Boolean, type: Boolean,
key: 'guest' key: 'guest'
}); });
this.link ({_isGuest: isGuest}, {'changed': this._onGuestChange}); this.link ({_isGuest: isGuest}, {'changed': this._onGuestChange});
var token = new Vn.HashParam var token = new Vn.Param
({ ({
lot: this._hash,
type: String, type: String,
key: 'token' key: 'token'
}); });

View File

@ -1,8 +1,9 @@
module.exports = module.exports =
{ {
check: function (conn, callback) check: function (conn, hash, callback)
{ {
this.hash = hash;
conn.execQuery ('CALL basketCheck ()', conn.execQuery ('CALL basketCheck ()',
this._onBasketCheck.bind (this, callback)); this._onBasketCheck.bind (this, callback));
} }
@ -21,6 +22,6 @@ module.exports =
if (callback) if (callback)
callback (isOk); callback (isOk);
if (!isOk) if (!isOk)
Vn.Hash.set ({'form': 'ecomerce/checkout'}); this.hash.setAll ({'form': 'ecomerce/checkout'});
} }
}; };

View File

@ -23,6 +23,7 @@ module.exports = new Class
var builder = new Vn.Builder (); var builder = new Vn.Builder ();
builder.signalData = this; builder.signalData = this;
builder.add ('conn', this.conn); builder.add ('conn', this.conn);
builder.add ('hash', this.hash);
builder.loadXml ('forms/'+ this.formInfo.path +'/ui.xml'); builder.loadXml ('forms/'+ this.formInfo.path +'/ui.xml');
var res = this.builderResultInit (builder); var res = this.builderResultInit (builder);

View File

@ -318,7 +318,7 @@
{ {
margin-left: 0; margin-left: 0;
} }
.vn-gui .menu-button .vn-gui .navbar .menu-button
{ {
display: block; display: block;
} }

View File

@ -77,8 +77,11 @@ module.exports = new Class
window.addEventListener ('scroll', this._onScrollHandler ); window.addEventListener ('scroll', this._onScrollHandler );
} }
this.hash = Vn.Hash; this.formParam = new Vn.Param ({
this.formParam = new Vn.HashParam ({key: 'form'}); lot: this.hash,
type: String,
key: 'form'
});
this.formParam.on ('changed', this._onFormChange, this); this.formParam.on ('changed', this._onFormChange, this);
if (!localStorage.getItem ('hederaCookies')) if (!localStorage.getItem ('hederaCookies'))
@ -220,7 +223,7 @@ module.exports = new Class
if (res.get ('path')) if (res.get ('path'))
{ {
a.href = Vn.Hash.make ({'form': res.get ('path')}); a.href = this.hash.make ({'form': res.get ('path')});
this.menuOptions[res.get ('path')] = a; this.menuOptions[res.get ('path')] = a;
} }
@ -475,7 +478,7 @@ module.exports = new Class
form: 'preview', form: 'preview',
report: reportName report: reportName
}; };
Vn.Hash.set (Object.assign (hashParams, params)); this.hash.setAll (Object.assign (hashParams, params));
} }
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Supplant //++++++++++++++++++++++++++++++++++++++++++++++++++++++ Supplant

View File

@ -3,6 +3,11 @@ module.exports = new Class
({ ({
Extends: Htk.Component Extends: Htk.Component
,activate: function ()
{
this.renderReport ();
}
,open: function (batch, body) ,open: function (batch, body)
{ {
this.batch = batch; this.batch = batch;
@ -11,11 +16,6 @@ module.exports = new Class
this.activate (batch, body); this.activate (batch, body);
} }
,activate: function (batch, body)
{
this.renderReport ();
}
,openIframe: function (batch) ,openIframe: function (batch)
{ {
this.batch = batch; this.batch = batch;

View File

@ -46,12 +46,10 @@ module.exports = new Class
if (!this._conn || this._priority === null) if (!this._conn || this._priority === null)
return; return;
var batch = new Sql.Batch (); var params = {priority: this._priority};
batch.addValue ('priority', this._priority);
var query = 'SELECT title, link, icon FROM social ' var query = 'SELECT title, link, icon FROM social '
+'WHERE priority >= #priority ORDER BY priority'; +'WHERE priority >= #priority ORDER BY priority';
this._conn.execQuery (query, this._onQueryDone.bind (this), batch); this._conn.execQuery (query, this._onQueryDone.bind (this), params);
} }
,_onQueryDone: function (resultSet) ,_onQueryDone: function (resultSet)

View File

@ -56,15 +56,15 @@
} }
/* Mobile - High DPI */ /* Mobile - High DPI */
@media screen and @media
(max-device-width: 411px) and (min-resolution: 249dpi), screen and (max-device-width: 411px) and (min-resolution: 249dpi),
(max-device-width: 411px) and (-webkit-min-device-pixel-ratio: 3) screen and (max-device-width: 411px) and (-webkit-min-device-pixel-ratio: 3)
{ {
body { font-size: 10pt; } body { font-size: 10pt; }
} }
@media screen and @media
(min-device-width: 412px) and (min-resolution: 249dpi), screen and (min-device-width: 412px) and (min-resolution: 249dpi),
(min-device-width: 412px) and (-webkit-min-device-pixel-ratio: 3) screen and (min-device-width: 412px) and (-webkit-min-device-pixel-ratio: 3)
{ {
body { font-size: 11pt; } body { font-size: 11pt; }
} }
@ -160,6 +160,7 @@ button,
.clickable .clickable
{ {
transition: background-color 200ms ease-out; transition: background-color 200ms ease-out;
-webkit-transition: background-color 200ms ease-out;
} }
button:hover, button:hover,
.list-row:hover, .list-row:hover,
@ -171,6 +172,7 @@ button:hover,
.clickable-img .clickable-img
{ {
transition: opacity 200ms ease-out; transition: opacity 200ms ease-out;
-webkit-transition: opacity 200ms ease-out;
} }
.clickable-img:hover .clickable-img:hover
{ {

View File

@ -8,17 +8,17 @@ module.exports = new Class
,check: function (callback) ,check: function (callback)
{ {
this.tpvOrder = Vn.Hash.get ('tpvOrder'); this.tpvOrder = this.hash.get ('tpvOrder');
this.tpvStatus = Vn.Hash.get ('tpvStatus'); this.tpvStatus = this.hash.get ('tpvStatus');
if (this.tpvStatus) if (this.tpvStatus)
{ {
var batch = new Sql.Batch ();
batch.addValue ('transaction', this.tpvOrder);
batch.addValue ('status', this.tpvStatus);
var query = 'CALL transactionEnd (#transaction, #status)'; var query = 'CALL transactionEnd (#transaction, #status)';
this.conn.execQuery (query, null, batch); var params = {
transaction: this.tpvOrder,
status: this.tpvStatus
};
this.conn.execQuery (query, null, params);
} }
if (callback) if (callback)
@ -35,10 +35,10 @@ module.exports = new Class
if (amount > 0) if (amount > 0)
{ {
var params = { var params = {
'amount': parseInt (amount) amount: parseInt (amount)
,'urlOk': this._makeUrl ('ok') ,urlOk: this._makeUrl ('ok')
,'urlKo': this._makeUrl ('ko') ,urlKo: this._makeUrl ('ko')
,'company': company ,company: company
}; };
this.conn.send ('tpv/transaction', params, this.conn.send ('tpv/transaction', params,
@ -48,7 +48,7 @@ module.exports = new Class
Htk.Toast.showError (_('AmountError')); Htk.Toast.showError (_('AmountError'));
} }
,_onTransactionStart: function (json, error) ,_onTransactionStart: function (json)
{ {
if (json) if (json)
{ {
@ -59,9 +59,9 @@ module.exports = new Class
var fieldsMap = var fieldsMap =
{ {
'Ds_SignatureVersion': 'HMAC_SHA256_V1' Ds_SignatureVersion: 'HMAC_SHA256_V1'
,'Ds_MerchantParameters': json.params ,Ds_MerchantParameters: json.params
,'Ds_Signature': json.signature ,Ds_Signature: json.signature
}; };
for (var field in fieldsMap) for (var field in fieldsMap)
@ -83,15 +83,13 @@ module.exports = new Class
,retryPay: function () ,retryPay: function ()
{ {
var batch = new Sql.Batch ();
batch.addValue ('transaction', parseInt (this.tpvOrder));
var query = 'SELECT t.amount, m.company_id ' var query = 'SELECT t.amount, m.company_id '
+'FROM tpv_transaction_view t ' +'FROM tpv_transaction_view t '
+'JOIN tpv_merchant m ON t.merchant_id = m.id ' +'JOIN tpv_merchant m ON t.merchant_id = m.id '
+'WHERE t.id = #transaction'; +'WHERE t.id = #transaction';
var params = {transaction: parseInt (this.tpvOrder)};
this.conn.execQuery (query, this.conn.execQuery (query,
this._onRetryPayDone.bind (this), batch); this._onRetryPayDone.bind (this), params);
} }
,_onRetryPayDone: function (resultSet) ,_onRetryPayDone: function (resultSet)
@ -104,13 +102,13 @@ module.exports = new Class
Htk.Toast.showError (_('AmountError')); Htk.Toast.showError (_('AmountError'));
} }
,_makeUrl: function (status, order) ,_makeUrl: function (status)
{ {
var path = location.protocol +'//'+ location.host; var path = location.protocol +'//'+ location.host;
path += location.port ? ':'+ location.port : ''; path += location.port ? ':'+ location.port : '';
path += location.pathname; path += location.pathname;
path += location.search ? location.search : ''; path += location.search ? location.search : '';
path += Vn.Hash.make ({ path += this.hash.make ({
'form': 'ecomerce/orders', 'form': 'ecomerce/orders',
'tpvStatus': status, 'tpvStatus': status,
'tpvOrder': '%s' 'tpvOrder': '%s'

View File

@ -5,7 +5,6 @@ module.exports = new Class
({ ({
Extends: Widget Extends: Widget
,Tag: 'htk-field' ,Tag: 'htk-field'
,Child: 'param'
,Properties: ,Properties:
{ {
value: value:
@ -22,7 +21,7 @@ module.exports = new Class
this.valueChanged (x); this.valueChanged (x);
this.putValue (x); this.putValue (x);
} }
,get: function (x) ,get: function ()
{ {
return this._value; return this._value;
} }
@ -56,22 +55,22 @@ module.exports = new Class
return this._editable; return this._editable;
} }
}, },
form: lot:
{ {
type: Db.Iterator type: Db.Iterator
,set: function (x) ,set: function (x)
{ {
this._form = x; this._lot = x;
this.bindToForm (); this.bindToLot ();
} }
}, },
column: name:
{ {
type: String type: String
,set: function (x) ,set: function (x)
{ {
this._paramName = x; this._paramName = x;
this.bindToForm (); this.bindToLot ();
} }
}, },
conditionalFunc: conditionalFunc:
@ -97,13 +96,13 @@ module.exports = new Class
} }
} }
,bindToForm: function () ,bindToLot: function ()
{ {
if (this._form && this._paramName) if (this._lot && this._paramName)
this.param = new Db.Param this.param = new Vn.Param
({ ({
form: this._form lot: this._lot
,column: this._paramName ,name: this._paramName
}); });
} }

View File

@ -1,169 +0,0 @@
var Object = require ('./object');
var Value = require ('./value');
/**
* A map container for many Sql.Object
*/
module.exports = new Class
({
Extends: Object
,Tag: 'sql-batch'
,Properties:
{
blocked:
{
type: Boolean
,set: function (x)
{
this._blocked = x;
}
,get: function ()
{
return this._blocked;
}
}
}
,objects: {}
,_blocked: false
,loadXml: function (builder, node)
{
this.parent (builder, node);
var childs = node.childNodes;
for (var i = 0; i < childs.length; i++)
if (childs[i].tagName && childs[i].tagName.toLowerCase () == 'item')
{
var object;
var id = childs[i].getAttribute ('name');
if (id)
{
if (object = builder.getById (childs[i].getAttribute ('param')))
this.addParam (id, object);
else if (object = builder.getById (childs[i].getAttribute ('object')))
this.addObject (id, object);
}
}
}
,get: function (id)
{
if (this.objects[id])
return this.objects[id];
return null;
}
,add: function (id)
{
if (!this.objects[id])
this.objects[id] = null;
}
,_addObject: function (id, object)
{
this.remove (id);
this.objects[id] = object;
object.on ('changed', this.emitChanged, this);
this.emitChanged ();
}
,addObject: function (id, object)
{
this._addObject (id, object.ref ());
}
,addValue: function (id, value)
{
this._addObject (id,
new Value ({value: value}));
}
,addValues: function (values)
{
for (var id in values)
this.addValue (id, values[id]);
}
,addParam: function (id, param)
{
this._addObject (id,
new Value ({param: param}));
}
,getValue: function (id)
{
var object = this.objects[id];
if (object instanceof Value)
return object.value;
return null;
}
,addParams: function (params)
{
for (var id in params)
this.addParam (id, params[id]);
}
,remove: function (id)
{
if (this.objects[id])
{
this._unrefObject (this.objects[id]);
delete this.objects[id];
}
}
,block: function ()
{
this._blocked = true;
}
,unblock: function ()
{
this._blocked = false;
}
,emitChanged: function ()
{
if (!this._blocked)
this.signalEmit ('changed');
}
,changed: function ()
{
this.signalEmit ('changed');
}
,isReady: function ()
{
for (var id in this.objects)
if (!(this.objects[id] && this.objects[id].isReady ()))
return false;
return true;
}
,_unrefObject: function (object)
{
if (object)
{
object.disconnect ('changed', this.emitChanged, this);
object.unref ();
}
}
,_destroy: function ()
{
for (var id in this.objects)
this._unrefObject (this.objects[id]);
this.parent ();
}
});

View File

@ -1,12 +1,13 @@
var Object = require ('./object'); var SqlObject = require ('./object');
var Value = require ('./value');
/** /**
* A holder for another object. * A holder for another object.
*/ */
module.exports = new Class module.exports = new Class
({ ({
Extends: Object Extends: SqlObject
,Properties: ,Properties:
{ {
id: id:
@ -16,12 +17,21 @@ module.exports = new Class
} }
} }
,render: function (batch) ,render: function (params)
{ {
var object; var object;
if (batch && (object = batch.get (this.id))) if (params && (object = params[this.id]))
return object.render (batch); {
if (!(object instanceof SqlObject))
{
var sqlValue = new Value ();
sqlValue.value = object;
return sqlValue.render ();
}
else
return object.render (params);
}
return '#'+ this.id; return '#'+ this.id;
} }

View File

@ -8,10 +8,10 @@ module.exports = new Class
/** /**
* Renders the object as an SQL string. * Renders the object as an SQL string.
* *
* @param {Sql.Batch} batch The batch used to render the object * @param {Object} params The params used to render the object
* @return {String} The SQL string * @return {String} The SQL string
*/ */
,render: function (batch) {} ,render: function () {}
/** /**
* Gets if the object is ready to be rendered. * Gets if the object is ready to be rendered.
@ -26,7 +26,7 @@ module.exports = new Class
/** /**
* Through the query looking for containers and adds it to the batch. * Through the query looking for containers and adds it to the batch.
* *
* @return {Sql.Batch} batch The batch * @return {Object} The found statement parameters
*/ */
,findHolders: function (batch) {} ,findHolders: function () {}
}); });

View File

@ -4,7 +4,6 @@ require ('vn/vn');
Sql = module.exports = { Sql = module.exports = {
Object : require ('./object') Object : require ('./object')
,Holder : require ('./holder') ,Holder : require ('./holder')
,Batch : require ('./batch')
,List : require ('./list') ,List : require ('./list')
,Expr : require ('./expr') ,Expr : require ('./expr')
,Value : require ('./value') ,Value : require ('./value')

View File

@ -1,11 +1,11 @@
var Object = require ('./object'); var Object = require ('./object');
var Set = require ('./set'); var Lot = require ('./lot');
module.exports = new Class module.exports = new Class
({ ({
Extends: Object Extends: Object
,Implements: Set ,Implements: Lot
,Tag: 'vn-basic-set' ,Tag: 'vn-basic-set'
,Properties: ,Properties:
{ {

View File

@ -1,15 +0,0 @@
var Object = require ('./object');
/**
* Class to handle the URL.
*/
module.exports = new Class
({
Extends: Object
,changed: function ()
{
this.signalEmit ('changed');
}
});

View File

@ -1,138 +0,0 @@
var Object = require ('./object');
var Param = require ('./param');
var Hash = require ('./hash');
var Type = require ('./type');
var VnDate = require ('./date');
module.exports = new Class
({
Extends: Object
,Tag: 'vn-hash-param'
,Child: 'param'
,Properties:
{
param:
{
type: Param
,set: function (x)
{
this.link ({_param: x}, {'changed': this._onParamChange});
this._refreshParam ();
}
,get: function ()
{
return this._param;
}
},
key:
{
type: String
,set: function (x)
{
this._key = x;
this._onHashChange ();
}
,get: function ()
{
return this._key;
}
},
value:
{
type: Object
,set: function (x)
{
this._setValue (x, true);
}
,get: function ()
{
return this._value;
}
},
type:
{
type: Type
,set: function (x)
{
this._type = x;
this._onHashChange ();
}
,get: function ()
{
return this._type;
}
}
}
,_hashLock: false
,_paramLock: false
,_value: undefined
,_key: null
,_type: null
,initialize: function (props)
{
this.parent (props);
var listener = Hash.getListener ();
this.link ({_listener: listener}, {'changed': this._onHashChange});
this._onHashChange ();
}
,_onHashChange: function ()
{
if (this._hashLock || !this._key || !this._listener)
return;
var newValue = Hash.get (this._key, this._type);
this._hashLock = true;
this._setValue (newValue, true);
this._hashLock = false;
}
,_setValue: function (newValue, signal)
{
if (newValue == this._value)
return;
this._value = newValue;
if (this._key && !this._hashLock)
{
this._hashLock = true;
var map = {};
map[this._key] = newValue;
Hash.add (map);
this._hashLock = false;
}
this._refreshParam ();
if (signal)
this.signalEmit ('changed', newValue);
}
,_refreshParam: function ()
{
if (this._param && !this._paramLock)
{
this._paramLock = true;
this._param.value = this._value;
this._paramLock = false;
}
}
,_onParamChange: function ()
{
if (this._paramLock)
return;
this._paramLock = true;
this._setValue (this._param.value);
this._paramLock = false;
}
});

View File

@ -1,58 +1,78 @@
var HashListener = require ('./hash-listener'); var VnObject = require ('./object');
var VnDate = require ('./date'); var VnDate = require ('./date');
var Lot = require ('./lot');
/** /**
* Class to handle the URL. * Class to handle the URL.
*/ */
module.exports = module.exports = new Class
{ ({
_hash: null Extends: VnObject
,_hashMap: {} ,Implements: Lot
,_listener: null ,Properties: {
window:
,initialize: function ()
{ {
this._listener = new HashListener (); type: Window
,set: function (x)
this._hashChangedHandler = this._hashChanged.bind (this); {
window.addEventListener ('hashchange', this._hashChangedHandler); this._window = x;
x.addEventListener ('hashchange', this._hashChangedHandler);
this._hashChanged (); this._hashChanged ();
} }
,get: function ()
,destroy: function ()
{ {
window.removeEventListener ('hashchange', this._hashChangedHandler); return this._window;
}
},
params:
{
type: Object
,set: function (x)
{
this.setAll (x);
}
,get: function ()
{
return this._hashMap;
}
}
} }
,getListener: function () ,initialize: function (props)
{ {
return this._listener; this._hash = null;
this._hashMap = null;
this._window = null;
this._hashChangedHandler = this._hashChanged.bind (this);
this.parent (props);
} }
/**
* Gets the hash part of the URL.
*
* @param {string} key The variable name
*/
,get: function (key, type) ,get: function (key, type)
{ {
return this.parseValue (this._hashMap[key], type); return this.parseValue (this._hashMap[key], type);
} }
,set: function (key, value)
{
var map = {};
map[key] = value;
this.assign (map);
}
/** /**
* Sets the hash part of the URL, respecting the current hash variables. * Sets the hash part of the URL, respecting the current hash variables.
* *
* @param {Object} map A key-value map * @param {Object} map A key-value map
*/ */
,add: function (map) ,assign: function (map)
{ {
var newMap = this._hashMap; var newMap = this._hashMap;
for (var key in map) for (var key in map)
newMap[key] = map[key]; newMap[key] = map[key];
this.set (newMap); this.setAll (newMap);
} }
/** /**
@ -60,7 +80,7 @@ module.exports =
* *
* @param {Object} map A key-value map * @param {Object} map A key-value map
*/ */
,set: function (map) ,setAll: function (map)
{ {
if (map) if (map)
for (var key in map) for (var key in map)
@ -81,7 +101,7 @@ module.exports =
location.hash = newHash; location.hash = newHash;
this._blockChanged = false; this._blockChanged = false;
this._listener.changed (); this.changed ();
} }
} }
@ -106,7 +126,7 @@ module.exports =
if (hash.length > 2) if (hash.length > 2)
hash += '&'; hash += '&';
hash += key +'='+ this.renderValue (map[key]); hash += encodeURIComponent (key) +'='+ this.renderValue (map[key]);
} }
return hash; return hash;
@ -127,12 +147,12 @@ module.exports =
var kvPair = kvPairs[i].split ('=', 2); var kvPair = kvPairs[i].split ('=', 2);
if (kvPair[0]) if (kvPair[0])
newMap[kvPair[0]] = decodeURIComponent (kvPair[1]); newMap[decodeURIComponent (kvPair[0])] = decodeURIComponent (kvPair[1]);
} }
this._hashMap = newMap; this._hashMap = newMap;
this._hash = newHash; this._hash = newHash;
this._listener.changed (); this.changed ();
} }
,renderValue: function (v) ,renderValue: function (v)
@ -171,4 +191,11 @@ module.exports =
return v; return v;
} }
};
,_destroy: function ()
{
this._window.removeEventListener ('hashchange', this._hashChangedHandler);
this._window = null;
this.parent ();
}
});

View File

@ -1,71 +1,157 @@
var Object = require ('./object'); var VnObject = require ('./object');
var Param = require ('./param'); var Lot = require ('./lot');
var Value = require ('./value'); var Type = require ('./type');
/**
* Simply a linkable value holder.
*/
module.exports = new Class module.exports = new Class
({ ({
Extends: Object Extends: VnObject
,Tag: 'vn-param' ,Tag: 'vn-param'
,Child: 'param'
,Properties: ,Properties:
{ {
value: param:
{
type: Object
,set: function (x)
{
this.link ({_param: x}, {'changed': this._onParamChange});
this._refreshParam ();
}
,get: function ()
{
return this._param;
}
},
key:
{ {
type: String type: String
,set: function (x) ,set: function (x)
{ {
if (Value.compare (x, this._value)) this._key = x;
return; this._onLotChange ();
if (x instanceof Date)
x = x.clone ();
this._value = x;
if (this._master && !this.masterLock)
{
this.masterLock = true;
this._master.value = x;
this.masterLock = false;
} }
,get: function ()
this.signalEmit ('changed', this._value); {
return this._key;
}
},
value:
{
type: Object
,set: function (x)
{
this._setValue (x, true);
} }
,get: function () ,get: function ()
{ {
return this._value; return this._value;
} }
}, },
master: type:
{ {
type: Param type: Type
,set: function (x) ,set: function (x)
{ {
this.link ({_master: x}, {'changed': this._onMasterChange}); this._type = x;
this._onMasterChange (); this._onLotChange ();
} }
,get: function () ,get: function ()
{ {
return this._master; return this._type;
} }
} },
} lot:
,_value: undefined
,_master: null
,masterLock: false
,_onMasterChange: function ()
{ {
if (this.masterLock) type: Lot
,set: function (x)
{
this.link ({_lot: x}, {'change': this._onLotChange});
this._onLotChange ();
}
,get: function ()
{
return this._lot;
}
},
/**
* Determines whether the link to the form is unidirectional, ie, a
* change in the lot updates the parameter but not vice versa.
*/
oneWay:
{
type: Boolean
,set: function (x)
{
this._oneWay = x;
}
,get: function ()
{
return this._oneWay;
}
}
}
,_lotLock: false
,_paramLock: false
,_value: undefined
,_lot: null
,_key: null
,_type: null
,_oneWay: false
,_onLotChange: function ()
{
if (this._lotLock || !this._key || !this._lot)
return; return;
this.masterLock = true; var newValue = this._lot.get (this._key, this._type);
this.value = this._master.value;
this.masterLock = false; this._lotLock = true;
this._setValue (newValue, true);
this._lotLock = false;
}
,_setValue: function (newValue, signal)
{
if (newValue == this._value)
return;
if (newValue instanceof Date)
newValue = newValue.clone ();
this._value = newValue;
if (this._lot && this._key && !this._lotLock && !this._oneWay)
{
this._lotLock = true;
this._lot.set (this._key, newValue);
this._lotLock = false;
}
this._refreshParam ();
if (signal)
this.signalEmit ('changed', newValue);
}
,_refreshParam: function ()
{
if (this._param && !this._paramLock)
{
this._paramLock = true;
this._param.value = this._value;
this._paramLock = false;
}
}
,_onParamChange: function ()
{
if (this._paramLock)
return;
this._paramLock = true;
this._setValue (this._param.value);
this._paramLock = false;
} }
}); });

View File

@ -12,12 +12,10 @@ Vn = module.exports = {
,Value : require ('./value') ,Value : require ('./value')
,Url : require ('./url') ,Url : require ('./url')
,Mutators : require ('./mutators') ,Mutators : require ('./mutators')
,Set : require ('./set') ,Lot : require ('./lot')
,BasicSet : require ('./basic-set') ,BasicLot : require ('./basic-lot')
,Param : require ('./param')
,HashListener : require ('./hash-listener')
,Hash : require ('./hash') ,Hash : require ('./hash')
,HashParam : require ('./hash-param') ,Param : require ('./param')
,Node : require ('./node') ,Node : require ('./node')
,Builder : require ('./builder') ,Builder : require ('./builder')
,JsonException : require ('./json-exception') ,JsonException : require ('./json-exception')

View File

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

View File

@ -72,8 +72,8 @@ var devConfig = {
port: wpConfig.devServerPort, port: wpConfig.devServerPort,
headers: { "Access-Control-Allow-Origin": "*" }, headers: { "Access-Control-Allow-Origin": "*" },
stats: { chunks: false } stats: { chunks: false }
}, }/*,
devtool: 'eval-source-map' devtool: 'eval-source-map'*/
}; };
var mrgConfig = devMode ? devConfig : prodConfig; var mrgConfig = devMode ? devConfig : prodConfig;