This commit is contained in:
Juan Ferrer Toribio 2017-03-30 13:44:53 +02:00
parent a5854290e9
commit efdde01e19
47 changed files with 619 additions and 475 deletions

View File

@ -41,19 +41,19 @@
<div class="card form"> <div class="card form">
<div> <div>
<label><t>Name</t></label> <label><t>Name</t></label>
<htk-entry column="consignee" form="iter"/> <htk-entry form="iter" column="consignee"/>
</div> </div>
<div> <div>
<label><t>Address</t></label> <label><t>Address</t></label>
<htk-entry column="name" form="iter"/> <htk-entry form="iter" column="name"/>
</div> </div>
<div> <div>
<label><t>City</t></label> <label><t>City</t></label>
<htk-entry column="city" form="iter"/> <htk-entry form="iter" column="city"/>
</div> </div>
<div> <div>
<label><t>ZipCode</t></label> <label><t>ZipCode</t></label>
<htk-entry column="zip_code" form="iter"/> <htk-entry form="iter" column="zip_code"/>
</div> </div>
<div> <div>
<label><t>Country</t></label> <label><t>Country</t></label>
@ -74,7 +74,7 @@
</div> </div>
<div> <div>
<label><t>Province</t></label> <label><t>Province</t></label>
<htk-combo column="province_id" form="iter"> <htk-combo form="iter" column="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

@ -5,19 +5,16 @@ Hedera.Items = new Class
,activate: function () ,activate: function ()
{ {
this.$('warehouse').value = 7; var set = this.$('set');
this.$('realm').value = null; set.set ('warehouse', 7);
set.set ('realm', null);
} }
,onPreviewClick: function () ,onShowClick: function ()
{ {
var batch = new Sql.Batch (); var set = this.$('set');
batch.addValues ({ set.set ('rate', this.$('rate').value);
'warehouse': this.$('warehouse').value this.gui.openReport ('items-report', set.params);
,'realm': this.$('realm').value
,'rate': this.$('rate').value
});
this.gui.openReport ('items-report', batch);
} }
}); });

View File

@ -5,5 +5,5 @@
,"Realm": "Realm" ,"Realm": "Realm"
,"Rate": "Rate" ,"Rate": "Rate"
,"Preview": "Preview" ,"Show": "Show"
} }

View File

@ -5,5 +5,5 @@
,"Realm": "Reino" ,"Realm": "Reino"
,"Rate": "Tarifa" ,"Rate": "Tarifa"
,"Preview": "Mostrar" ,"Show": "Mostrar"
} }

View File

@ -5,5 +5,5 @@
,"Realm": "Realm" ,"Realm": "Realm"
,"Rate": "Rate" ,"Rate": "Rate"
,"Preview": "Preview" ,"Show": "Show"
} }

View File

@ -5,5 +5,5 @@
,"Realm": "Reino" ,"Realm": "Reino"
,"Rate": "Tarifa" ,"Rate": "Tarifa"
,"Preview": "Mostrar" ,"Show": "Mostrar"
} }

View File

@ -1,19 +1,19 @@
<vn> <vn>
<vn-basic-set id="set"/>
<h1 id="title"> <h1 id="title">
<t>Item list</t> <t>Item list</t>
</h1> </h1>
<div id="actions" class="action-bar"> <div id="actions" class="action-bar">
<htk-bar-button <htk-bar-button
icon="print" icon="show"
tip="_Preview" tip="_Show"
on-click="onPreviewClick"/> on-click="onShowClick"/>
</div> </div>
<div id="main" class="items"> <div id="main" class="items">
<div class="card form"> <div class="card form">
<div> <div>
<label><t>Store</t></label> <label><t>Store</t></label>
<htk-combo> <htk-combo form="set" column="warehouse">
<vn-param property="param" id="warehouse"/>
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT id, name FROM vn2008.warehouse SELECT id, name FROM vn2008.warehouse
@ -24,8 +24,7 @@
</div> </div>
<div> <div>
<label><t>Realm</t></label> <label><t>Realm</t></label>
<htk-combo not-null="false"> <htk-combo form="set" column="realm" not-null="false">
<vn-param property="param" id="realm"/>
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT id, reino FROM vn2008.reinos SELECT id, reino FROM vn2008.reinos

View File

@ -12,7 +12,7 @@
,"Show packing": "Show packing" ,"Show packing": "Show packing"
,"Stack different items": "Stack different items" ,"Stack different items": "Stack different items"
,"Preview": "Preview" ,"Show": "Show"
,"Pallets": "Pallets" ,"Pallets": "Pallets"

View File

@ -12,7 +12,7 @@
,"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"
,"Preview": "Mostrar" ,"Show": "Mostrar"
,"Pallets": "Palets" ,"Pallets": "Palets"

View File

@ -12,7 +12,7 @@
,"Show packing": "Show packing" ,"Show packing": "Show packing"
,"Stack different items": "Stack different items" ,"Stack different items": "Stack different items"
,"Preview": "Preview" ,"Show": "Show"
,"Pallets": "Pallets" ,"Pallets": "Pallets"

View File

@ -12,7 +12,7 @@
,"Show packing": "Mostrar unidades por caixa" ,"Show packing": "Mostrar unidades por caixa"
,"Stack different items": "Empilhar ítens diferentes" ,"Stack different items": "Empilhar ítens diferentes"
,"Preview": "Mostrar" ,"Show": "Mostrar"
,"Pallets": "Palets" ,"Pallets": "Palets"

View File

@ -5,49 +5,19 @@ Hedera.Shelves = new Class
,activate: function () ,activate: function ()
{ {
this.$('date').value = new Date (); var set = this.$('set');
this.$('useIds').value = false; set.set ('date', new Date ());
set.set ('useIds', false);
} }
,onConfigChange: function () ,onConfigChange: function ()
{ {
var fields = [ this.$('set').assign (this.$('config'));
'realm'
,'family'
,'warehouse'
,'shelf'
,'namePrefix'
,'maxAmount'
,'reportTitle'
,'showPacking'
,'stack'
];
for (var i = 0; i < fields.length; i++)
this.$(fields[i]).value = this.$('config').get (fields[i]);
} }
,onPreviewClick: function () ,onShowClick: function ()
{ {
var fields = [ this.gui.openReport ('shelves-report', this.$('set').params);
'family'
,'warehouse'
,'shelf'
,'namePrefix'
,'maxAmount'
,'reportTitle'
,'showPacking'
,'stack'
,'useIds'
,'date'
];
var batch = new Sql.Batch ();
for (var i = 0; i < fields.length; i++)
batch.addValue (fields[i], this.$(fields[i]).value);
this.gui.openReport ('shelves-report', batch);
} }
}); });

View File

@ -1,23 +1,13 @@
<vn> <vn>
<vn-group>
<db-model property="model" id="configs-model">
<custom>
SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family,
c.shelf, c.maxAmount, c.showPacking, c.stack, t.reino_id realm
FROM shelfConfig c
JOIN vn2008.Tipos t ON t.tipo_id = c.family
</custom>
</db-model>
<vn-basic-set id="set"/> <vn-basic-set id="set"/>
</vn-group>
<h1 id="title"> <h1 id="title">
<t>Shelves</t> <t>Shelves</t>
</h1> </h1>
<div id="actions"> <div id="actions">
<htk-bar-button <htk-bar-button
icon="print" icon="show"
tip="_Preview" tip="_Show"
on-click="onPreviewClick"/> on-click="onShowClick"/>
</div> </div>
<div id="main" class="shelves"> <div id="main" class="shelves">
<div class="card form"> <div class="card form">
@ -28,16 +18,25 @@
placeholder="_Select config" placeholder="_Select config"
model="configs-model" model="configs-model"
on-changed="onConfigChange" on-changed="onConfigChange"
on-ready="onConfigChange"/> on-ready="onConfigChange">
<db-model property="model" id="configs-model">
<custom>
SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family,
c.shelf, c.maxAmount, c.showPacking, c.stack, t.reino_id realm
FROM shelfConfig c
JOIN vn2008.Tipos t ON t.tipo_id = c.family
</custom>
</db-model>
</htk-combo>
</div> </div>
<div> <div>
<label><t>Date</t></label> <label><t>Date</t></label>
<htk-date-chooser id="date"/> <htk-date-chooser form="set" column="date"/>
</div> </div>
<div> <div>
<label><t>Reign</t></label> <label><t>Reign</t></label>
<htk-combo id="realm"> <htk-combo form="set" column="realm" id="realm">
<db-model property="model" id="realms"> <db-model property="model">
<custom> <custom>
SELECT id, reino FROM vn2008.reinos SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino WHERE display != FALSE ORDER BY reino
@ -47,7 +46,7 @@
</div> </div>
<div> <div>
<label><t>Family</t></label> <label><t>Family</t></label>
<htk-combo id="family"> <htk-combo form="set" column="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
@ -63,7 +62,7 @@
</div> </div>
<div> <div>
<label><t>Store</t></label> <label><t>Store</t></label>
<htk-combo id="warehouse"> <htk-combo form="set" column="warehouse">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT id, name FROM vn2008.warehouse SELECT id, name FROM vn2008.warehouse
@ -74,7 +73,7 @@
</div> </div>
<div> <div>
<label><t>Shelf</t></label> <label><t>Shelf</t></label>
<htk-combo id="shelf"> <htk-combo form="set" column="shelf">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT id, name FROM shelf SELECT id, name FROM shelf
@ -84,27 +83,27 @@
</div> </div>
<div> <div>
<label><t>Name prefix</t></label> <label><t>Name prefix</t></label>
<htk-entry id="namePrefix"/> <htk-entry form="set" column="namePrefix"/>
</div> </div>
<div> <div>
<label><t>Limit amount per item</t></label> <label><t>Limit amount per item</t></label>
<htk-entry id="maxAmount"/> <htk-entry form="set" column="maxAmount"/>
</div> </div>
<div> <div>
<label><t>Title</t></label> <label><t>Title</t></label>
<htk-entry id="reportTitle"/> <htk-entry form="set" column="reportTitle"/>
</div> </div>
<div> <div>
<label><t>Show packing</t></label> <label><t>Show packing</t></label>
<htk-check id="showPacking"/> <htk-check form="set" column="showPacking"/>
</div> </div>
<div> <div>
<label><t>Stack different items</t></label> <label><t>Stack different items</t></label>
<htk-check id="stack"/> <htk-check form="set" column="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 id="useIds"/> <htk-check form="set" column="useIds"/>
</div> </div>
</div> </div>
</div> </div>

View File

@ -90,10 +90,6 @@
display: block; display: block;
float: left; float: left;
width: 33.33%; width: 33.33%;
}
.right-panel .realms a:hover
{
background-color: rgba(1, 1, 1, .05);
border-radius: .1em; border-radius: .1em;
} }
.right-panel .realms a > img .right-panel .realms a > img

View File

@ -225,7 +225,7 @@
</custom> </custom>
</db-model> </db-model>
<custom> <custom>
<a id="link"> <a id="link" class="clickable">
<img id="image"/> <img id="image"/>
</a> </a>
</custom> </custom>

View File

@ -7,7 +7,7 @@
SELECT o.id, o.date_send, o.note, o.company_id, SELECT o.id, o.date_send, o.note, o.company_id,
ag.description agency, v.code method, ag.description agency, v.code method,
ad.consignee, ad.zip_code, ad.city, ad.name address, ad.consignee, ad.zip_code, ad.city, ad.name address,
t.*, c.credit, customer_get_debt() debt t.*, c.credit, clientGetDebt() debt
FROM basket o FROM basket o
JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id
LEFT JOIN address_view ad ON ad.id = o.address_id LEFT JOIN address_view ad ON ad.id = o.address_id

View File

@ -8,10 +8,14 @@ Hedera.Orders = new Class
this.tpv = new Hedera.Tpv ({conn: this.conn}); this.tpv = new Hedera.Tpv ({conn: this.conn});
this.tpv.check (this._onTpvCheck.bind (this)); this.tpv.check (this._onTpvCheck.bind (this));
if (!this.$('from').value)
{
var from = new Date (); var from = new Date ();
from.setDate (from.getDate () - 25); from.setDate (from.getDate () - 25);
from.setHours (0, 0, 0, 0);
this.$('from').value = from; this.$('from').value = from;
} }
}
,_onTpvCheck: function (tpv, tpvOrder, tpvStatus) ,_onTpvCheck: function (tpv, tpvOrder, tpvStatus)
{ {

View File

@ -16,9 +16,15 @@ Hedera.Preview = new Class
this.gui.loaderPush (); this.gui.loaderPush ();
var module = new Hedera.Module ('reports', reportName); var module = new Hedera.Module ('reports', reportName);
this.reportModule = module;
module.load (this._onReportLoad.bind (this)); module.load (this._onReportLoad.bind (this));
} }
,deactivate: function ()
{
this.reportModule.unload ();
}
,_onReportLoad: function (module) ,_onReportLoad: function (module)
{ {
this.gui.loaderPop (); this.gui.loaderPop ();
@ -32,12 +38,15 @@ Hedera.Preview = new Class
var batch = new Sql.Batch (); var batch = new Sql.Batch ();
batch.addValues (Vn.Hash._hashMap); batch.addValues (Vn.Hash._hashMap);
var report = new module.klass (module, this.gui); this.report = new module.klass ({
report.open (batch, this.node); info: module,
conn: this.conn
});
this.report.open (batch, this.node);
} }
,onPrintClick: function () ,onPrintClick: function ()
{ {
this.doc.defaultView.print (); this.report.print ();
} }
}); });

View File

@ -8,5 +8,5 @@
tip="_Print" tip="_Print"
on-click="onPrintClick"/> on-click="onPrintClick"/>
</div> </div>
<div id="main" class="report"/> <div id="main" class="preview report"/>
</vn> </vn>

130
image/icon/dark/show.svg Normal file
View File

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<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"
id="svg7384"
sodipodi:docname="search.svg"
version="1.1"
inkscape:version="0.48.5 r10040"
height="16"
width="16">
<metadata
id="metadata90">
<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>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
inkscape:cy="8.9536526"
pagecolor="#555753"
borderopacity="1"
showborder="false"
inkscape:bbox-paths="false"
guidetolerance="10"
inkscape:object-paths="true"
inkscape:window-width="1296"
showguides="true"
inkscape:object-nodes="true"
inkscape:snap-bbox="true"
inkscape:pageshadow="2"
inkscape:guide-bbox="true"
inkscape:snap-nodes="false"
bordercolor="#666666"
objecttolerance="10"
id="namedview88"
showgrid="true"
inkscape:window-maximized="0"
inkscape:window-x="2192"
inkscape:snap-global="true"
inkscape:window-y="243"
gridtolerance="10"
inkscape:window-height="701"
inkscape:snap-to-guides="true"
inkscape:current-layer="layer12"
inkscape:snap-bbox-midpoints="false"
inkscape:zoom="16.3125"
inkscape:cx="7.1233965"
inkscape:snap-grids="true"
inkscape:pageopacity="1">
<inkscape:grid
spacingx="1px"
spacingy="1px"
id="grid4866"
empspacing="2"
enabled="true"
type="xygrid"
snapvisiblegridlinesonly="true"
visible="true" />
</sodipodi:namedview>
<title
id="title9167">Gnome Symbolic Icon Theme</title>
<defs
id="defs7386" />
<g
inkscape:label="status"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer9"
style="display:inline" />
<g
inkscape:label="devices"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer10" />
<g
inkscape:label="apps"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer11" />
<g
inkscape:label="actions"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer12">
<path
inkscape:connector-curvature="0"
d="m 146.50761,646.99554 c -3.02886,0 -5.51073,2.47905 -5.51073,5.50447 0,3.02541 2.48187,5.50446 5.51073,5.50446 3.02885,0 5.51072,-2.47905 5.51072,-5.50446 0,-3.02542 -2.48187,-5.50447 -5.51072,-5.50447 z m 0,2.00893 c 1.94735,0 3.49951,1.55039 3.49951,3.49554 0,1.94514 -1.55216,3.49553 -3.49951,3.49553 -1.94736,0 -3.49952,-1.55039 -3.49952,-3.49553 0,-1.94515 1.55216,-3.49554 3.49952,-3.49554 z"
id="path27918"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.55467153000000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Sans;-inkscape-font-specification:Sans" />
<path
inkscape:connector-curvature="0"
d="m 149.8125,655 a 1.0001,1.0001 0 0 0 -0.5,1.71875 l 4,4 a 1.0054782,1.0054782 0 1 0 1.40625,-1.4375 l -4,-4 A 1.0001,1.0001 0 0 0 149.8125,655 z"
id="path27941"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Sans;-inkscape-font-specification:Sans" />
</g>
<g
inkscape:label="places"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer13" />
<g
inkscape:label="mimetypes"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer14" />
<g
inkscape:label="emblems"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer15"
style="display:inline" />
<g
inkscape:label="categories"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="g4953"
style="display:inline" />
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -42,7 +42,7 @@ module.exports = new Class
return; return;
this._row = x; this._row = x;
this.iterChanged (); this.changed ();
} }
,get: function () ,get: function ()
{ {
@ -99,14 +99,14 @@ module.exports = new Class
if (ready) if (ready)
this.signalEmit ('ready'); this.signalEmit ('ready');
this.iterChanged (); this.changed ();
} }
} }
,onRowUpdate: function (model, row, column) ,onRowUpdate: function (model, row)
{ {
if (row == this._row) if (row == this._row)
this.iterChanged (); this.changed ();
} }
}); });

View File

@ -45,11 +45,11 @@ module.exports = new Class
} }
/** /**
* Emits the 'iter-changed' signal on the form. * Emits the 'change' signal on the form.
*/ */
,iterChanged: function () ,changed: function ()
{ {
this.signalEmit ('iter-changed'); this.signalEmit ('change');
} }
/** /**
@ -130,5 +130,13 @@ module.exports = new Class
{ {
return this._model.setByIndex (this._row, column, value); return this._model.setByIndex (this._row, column, value);
} }
,keys: function ()
{
if (this._model)
return Object.keys (this._model.columnMap);
return [];
}
}); });

View File

@ -438,7 +438,7 @@ Model.implement
* *
* @param {String} field The destination field name * @param {String} field The destination field name
* @param {String} table The destination table name * @param {String} table The destination table name
* @param {Object} value The default value * @param {*} value The default value
*/ */
,setDefaultFromValue: function (field, table, value) ,setDefaultFromValue: function (field, table, value)
{ {
@ -527,8 +527,8 @@ Model.implement
* Gets a value from the model. * Gets a value from the model.
* *
* @param {number} rowIndex The row index * @param {number} rowIndex The row index
* @param {string} columnName The column name * @param {String} columnName The column name
* @return {mixed} The value * @return {*} The value
*/ */
,get: function (rowIndex, columnName) ,get: function (rowIndex, columnName)
{ {
@ -544,8 +544,8 @@ Model.implement
* Updates a value on the model. * Updates a value on the model.
* *
* @param {number} rowIndex The row index * @param {number} rowIndex The row index
* @param {string} columnName The column name * @param {String} columnName The column name
* @param {mixed} value The new value * @param {*} value The new value
*/ */
,set: function (rowIndex, columnName, value) ,set: function (rowIndex, columnName, value)
{ {
@ -562,7 +562,7 @@ Model.implement
* *
* @param {number} rowIndex The row index * @param {number} rowIndex The row index
* @param {number} column The column index * @param {number} column The column index
* @return {mixed} The value * @return {*} The value
*/ */
,getByIndex: function (rowIndex, column) ,getByIndex: function (rowIndex, column)
{ {
@ -577,7 +577,7 @@ Model.implement
* *
* @param {number} rowIndex The row index * @param {number} rowIndex The row index
* @param {number} col The column index * @param {number} col The column index
* @param {mixed} value The new value * @param {*} value The new value
*/ */
,setByIndex: function (rowIndex, col, value) ,setByIndex: function (rowIndex, col, value)
{ {

View File

@ -32,17 +32,16 @@ module.exports = new Class
type: Form type: Form
,set: function (x) ,set: function (x)
{ {
this.link ({_form: x}, this.link ({_set: x},
{ {
'status-changed': this.onFormChange 'change': this.onSetChange
,'iter-changed': this.onIterChange
}); });
this.refresh (); this.refresh ();
} }
,get: function () ,get: function ()
{ {
return this._form; return this._set;
} }
}, },
/** /**
@ -64,11 +63,10 @@ module.exports = new Class
} }
,_columnName: null ,_columnName: null
,_form: null ,_set: null
,_formLock: false ,_setLock: false
,_columnIndex: -1
,_oneWay: false ,_oneWay: false
,_formValue: null ,_setValue: null
,initialize: function (props) ,initialize: function (props)
{ {
@ -78,38 +76,22 @@ module.exports = new Class
,refresh: function () ,refresh: function ()
{ {
if (this._form) if (this._set)
{ this.onSetChange ();
this.onFormChange ();
this.onIterChange ();
}
} }
,onFormChange: function () ,onSetChange: function ()
{ {
if (this._columnName != null) this._setLock = true;
this._columnIndex = this._form.getColumnIndex (this._columnName); var formValue = this._set.get (this._columnName);
}
,onIterChange: function ()
{
this._formLock = true;
var formValue;
if (this._columnIndex !== -1)
formValue = this._form.getByIndex (this._columnIndex);
else
formValue = undefined;
this.value = formValue; this.value = formValue;
this._formLock = false; this._setLock = false;
} }
,onChange: function () ,onChange: function ()
{ {
if (!this._formLock && this._columnIndex != -1 && !this.oneWay) if (!this._setLock && this._columnName && !this.oneWay)
this._form.setByIndex (this._columnIndex, this._value); this._set.set (this._columnName, this._value);
} }
}); });

View File

@ -12,6 +12,7 @@ module.exports = new Class
this.conn = gui.conn; this.conn = gui.conn;
this.hash = gui.hash; this.hash = gui.hash;
this.formInfo = formInfo; this.formInfo = formInfo;
this.parent ();
} }
,loadUi: function () ,loadUi: function ()

View File

@ -1,4 +1,6 @@
@media screen {
.vn-gui .vn-gui
{ {
height: inherit; height: inherit;
@ -32,7 +34,7 @@
transition-duration: 200ms; transition-duration: 200ms;
transition-timing-function: ease-in-out; transition-timing-function: ease-in-out;
} }
.vn-gui .menu-button .vn-gui .navbar .menu-button
{ {
position: absolute; position: absolute;
left: 0; left: 0;
@ -43,20 +45,16 @@
margin: 0; margin: 0;
height: 100%; height: 100%;
} }
.vn-gui .menu-button:hover .vn-gui .navbar .menu-button img
{
background-color: rgba(0, 0, 0, .2);
}
.vn-gui .menu-button img
{ {
vertical-align: middle; vertical-align: middle;
height: 1.8em; height: 1.8em;
} }
.vn-gui .title .vn-gui .navbar .title
{ {
float: left; float: left;
} }
.vn-gui .title > h1 .vn-gui .navbar .title > h1
{ {
font-weight: normal; font-weight: normal;
font-size: 1.4em; font-size: 1.4em;
@ -72,33 +70,29 @@
/* Action bar */ /* Action bar */
.vn-gui .action-bar .action-bar
{ {
float: right; float: right;
padding: 0; padding: 0;
margin: 0; margin: 0;
height: 100%; height: 100%;
} }
.vn-gui .action-bar > div .action-bar > div
{ {
padding: 0; padding: 0;
margin: 0; margin: 0;
height: 100%; height: 100%;
} }
.vn-gui .action-bar > div > * .action-bar > div > *
{ {
float: right; float: right;
} }
.vn-gui .action-bar button .action-bar button
{ {
margin: 0; margin: 0;
padding: 1.25em .5em; padding: 1.25em .5em;
} }
.vn-gui .action-bar button:hover .action-bar button > img
{
background-color: rgba(1, 1, 1, .2);
}
.vn-gui .action-bar button > img
{ {
vertical-align: middle; vertical-align: middle;
height: 1.4em; height: 1.4em;
@ -233,7 +227,6 @@
display: block; display: block;
line-height: 2.8em; line-height: 2.8em;
} }
.vn-gui .main-menu a:hover,
.vn-gui .main-menu a.selected .vn-gui .main-menu a.selected
{ {
background-color: rgba(1, 1, 1, .1); background-color: rgba(1, 1, 1, .1);
@ -278,6 +271,7 @@
transition-property: margin-left, margin-right; transition-property: margin-left, margin-right;
transition-duration: 200ms; transition-duration: 200ms;
} }
.vn-gui .form-holder .vn-gui .form-holder
{ {
height: inherit; height: inherit;
@ -304,9 +298,11 @@
-webkit-transform: translateZ(0) translateX(0em); -webkit-transform: translateZ(0) translateX(0em);
} }
} /*+++++++++ Screen end */
/* Mobile */ /* Mobile */
@media (max-width: 960px) @media screen and (max-width: 960px)
{ {
.vn-gui .action-bar span.label, .vn-gui .action-bar span.label,
.vn-gui .htk-button > span .vn-gui .htk-button > span
@ -362,3 +358,13 @@
} }
} }
/* Print */
@media print
{
.vn-gui .navbar,
.vn-gui .left-panel
{
display: none;
}
}

View File

@ -216,6 +216,7 @@ module.exports = new Class
var text = this.createTextNode (_(res.get ('description'))); var text = this.createTextNode (_(res.get ('description')));
var a = this.createElement ('a'); var a = this.createElement ('a');
a.className = 'clickable';
if (res.get ('path')) if (res.get ('path'))
{ {

View File

@ -1,6 +1,7 @@
require ('htk/htk'); require ('htk/htk');
require ('./style.css'); require ('./style.css');
require ('./report.css');
Hedera = module.exports = { Hedera = module.exports = {
Login : require ('./login') Login : require ('./login')

View File

@ -1,82 +1,54 @@
@font-face
{
font-family: 'Roboto';
src: url('roboto.ttf') format('truetype');
}
@media print @media print
{ {
body .report
{ {
font-size: 12pt;
-webkit-print-color-adjust: exact; -webkit-print-color-adjust: exact;
} }
.sheet .report .sheet
{ {
width: 100%; width: 100%;
page-break-after: always; page-break-after: always;
} }
#topbar }
@media screen
{ {
display: none; .report
{
background-color: #EEE;
}
.report .sheet
{
/* A4 -> 210x297mm */
width: 51em;
height: 72.1em;
background-color: white;
margin: 2em auto;
box-shadow: 0 .1em .1em #CCC;
padding: 5em;
} }
} }
@media screen @media screen
{ {
body .report { font-size: .8em; }
}
@media
screen and (min-resolution: 120dpi),
screen and (-webkit-min-device-pixel-ratio: 1.5)
{ {
background-color: #EEE; .report { font-size: .4em; }
padding-top: 3.9em;
} }
.sheet
{ .report
width: 210mm;
height: 297mm;
background-color: white;
margin: 10mm auto;
box-shadow: 0 1mm 1mm #CCC;
padding: 20mm;
}
#topbar
{
position: fixed;
top: 0;
left: 0;
right: 0;
height: 4em;
background-color: #009688;
z-index: 100;
box-shadow: 0 .1em .1em #AAA;
}
#topbar > button
{
float: right;
background-color: transparent;
color: white;
padding: .4em;
z-index: 100;
border: none;
cursor: pointer;
font-size: 1.15em;
height: 100%;
padding: 0 1em;
}
#topbar > button:hover
{
background-color: rgba(1, 1, 1, 0.2);
}
}
*
{
font-family: 'Roboto';
}
body
{ {
position: relative; position: relative;
margin: 0; margin: 0;
width: 100%; width: 100%;
z-index: -2; z-index: -2;
} }
.sheet .report .sheet
{ {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@ -86,35 +58,36 @@ body
/* Widgets */ /* Widgets */
.htk-grid .report .htk-grid
{ {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
padding: 0; padding: 0;
} }
.htk-grid > thead > tr .report .htk-grid > thead > tr
{ {
border-bottom: 1px solid #333; border-bottom: .01em solid #333;
height: 10mm; height: 2em;
background-color: initial;
} }
.htk-grid > thead th .report .htk-grid > thead th
{ {
text-align: left; text-align: left;
font-weight: normal; font-weight: normal;
color: initial;
} }
.htk-grid tr .report .htk-grid tr
{ {
height: 2em; height: 2em;
border: initial;
} }
.htk-grid > thead th, .report .htk-grid > thead th,
.htk-grid td .report .htk-grid td
{ {
padding-left: 3mm; padding-left: .3em;
} }
.htk-grid .cell-spin .report .htk-grid .cell-spin
{ {
text-align: right; text-align: right;
} }

View File

@ -3,49 +3,47 @@ module.exports = new Class
({ ({
Extends: Htk.Component Extends: Htk.Component
,initialize: function (moduleInfo, gui)
{
this.info = moduleInfo;
this.gui = gui;
this.conn = gui.conn;
this.parent (null);
}
,open: function (batch, body) ,open: function (batch, body)
{ {
this.batch = batch; this.batch = batch;
this.body = body; this.body = body;
this.createWindow (); this.reportWindow = body.ownerDocument.defaultView;
this.activate (batch, body);
} }
,print: function () ,activate: function (batch, body)
{ {
this.window.print (); this.renderReport ();
} }
,createWindow: function () ,openIframe: function (batch)
{ {
this.batch = batch;
var iframe = this.iframe = this.createElement ('iframe'); var iframe = this.iframe = this.createElement ('iframe');
iframe.src = 'js/hedera/report.html'; iframe.src = 'js/hedera/report.html';
iframe.style.display = 'none'; iframe.style.display = 'none';
document.body.appendChild (iframe); this.doc.body.appendChild (iframe);
var reportWindow = iframe.contentWindow; this.reportWindow = iframe.contentWindow;
this.reportWindow.addEventListener ('load',
reportWindow.addEventListener ('load',
this._onWindowLoad.bind (this)); this._onWindowLoad.bind (this));
this.window = reportWindow;
return true; return true;
} }
,_onWindowLoad: function () ,_onWindowLoad: function ()
{ {
this.doc = this.window.document this.body = this.reportWindow.document.body;
this.onWindowCreate (); this.renderReport ();
} }
,onWindowCreate: function () ,print: function ()
{
this.reportWindow.print ();
}
,renderReport: function ()
{ {
var builder = new Vn.Builder (); var builder = new Vn.Builder ();
builder.signalData = this; builder.signalData = this;

View File

@ -64,6 +64,7 @@ module.exports = new Class
var a = this.createElement ('a'); var a = this.createElement ('a');
a.href = res.get ('link'); a.href = res.get ('link');
a.target = '_blank'; a.target = '_blank';
a.className = 'clickable-img';
this._node.appendChild (a); this._node.appendChild (a);
var img = this.createElement ('img'); var img = this.createElement ('img');

View File

@ -14,53 +14,55 @@
} }
/* Desktop - Laptop 1360x768 */ /* Desktop - Laptop 1360x768 */
@media (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px) @media
screen and (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px)
{ {
body { font-size: 10pt; } body { font-size: 10pt; }
} }
/* Desktop - FHD 1920x1080 */ /* Desktop - FHD 1920x1080 */
@media (max-resolution: 119dpi) and (min-device-width: 1900px) @media
screen and (max-resolution: 119dpi) and (min-device-width: 1900px)
{ {
body { font-size: 13pt; } body { font-size: 13pt; }
} }
/* Mobile - Low DPI */ /* Mobile - Low DPI */
@media @media
(min-resolution: 120dpi), screen and (min-resolution: 120dpi),
(-webkit-min-device-pixel-ratio: 1.5) screen and (-webkit-min-device-pixel-ratio: 1.5)
{ {
body { font-size: 9pt; } body { font-size: 9pt; }
} }
@media @media
(min-resolution: 144dpi), screen and (min-resolution: 144dpi),
(-webkit-min-device-pixel-ratio: 1.5) screen and (-webkit-min-device-pixel-ratio: 1.5)
{ {
body { font-size: 11pt; } body { font-size: 11pt; }
} }
/* Mobile - Normal DPI */ /* Mobile - Normal DPI */
@media @media
(max-device-width: 383px) and (min-resolution: 192dpi), screen and (max-device-width: 383px) and (min-resolution: 192dpi),
(max-device-width: 383px) and (-webkit-min-device-pixel-ratio: 2) screen and (max-device-width: 383px) and (-webkit-min-device-pixel-ratio: 2)
{ {
body { font-size: 10pt; } body { font-size: 10pt; }
} }
@media @media
(min-device-width: 384px) and (min-resolution: 192dpi), screen and (min-device-width: 384px) and (min-resolution: 192dpi),
(min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2) screen and (min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2)
{ {
body { font-size: 11pt; } body { font-size: 11pt; }
} }
/* Mobile - High DPI */ /* Mobile - High DPI */
@media @media screen and
(max-device-width: 411px) and (min-resolution: 249dpi), (max-device-width: 411px) and (min-resolution: 249dpi),
(max-device-width: 411px) and (-webkit-min-device-pixel-ratio: 3) (max-device-width: 411px) and (-webkit-min-device-pixel-ratio: 3)
{ {
body { font-size: 10pt; } body { font-size: 10pt; }
} }
@media @media screen and
(min-device-width: 412px) and (min-resolution: 249dpi), (min-device-width: 412px) and (min-resolution: 249dpi),
(min-device-width: 412px) and (-webkit-min-device-pixel-ratio: 3) (min-device-width: 412px) and (-webkit-min-device-pixel-ratio: 3)
{ {
@ -72,14 +74,20 @@
body body
{ {
font-family: 'Roboto', 'Verdana', 'Sans'; font-family: 'Roboto', 'Verdana', 'Sans';
background-color: #EEE; margin: 0;
z-index: -2;
}
@media screen {
body
{
color: #333; color: #333;
position: absolute;
height: 100%; height: 100%;
width: 100%; width: 100%;
margin: 0; background-color: #EEE;
overflow: auto; overflow: auto;
z-index: -2; position: absolute;
} }
label, label,
button, button,
@ -116,19 +124,10 @@ a:active
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
} }
a:hover
{
text-decoration: none;
cursor: pointer;
}
a img a img
{ {
padding: 1px; padding: 1px;
} }
a img:hover
{
opacity: 0.9;
}
h1, h2, h3, h4, h5, h6 h1, h2, h3, h4, h5, h6
{ {
margin: 0; margin: 0;
@ -147,6 +146,37 @@ p
margin: 0.8em 0; margin: 0.8em 0;
} }
/* Efects */
button,
.list-row,
.clickable,
.clickable-img
{
cursor: pointer;
}
button,
.list-row,
.clickable
{
transition: background-color 200ms ease-out;
}
button:hover,
.list-row:hover,
.clickable:hover
{
background-color: rgba(1, 1, 1, 0.05);
}
.clickable-img
{
transition: opacity 200ms ease-out;
}
.clickable-img:hover
{
opacity: 0.85;
}
/* Focus outline */ /* Focus outline */
a:focus, a:focus,
@ -418,7 +448,6 @@ img.editable
display: block; display: block;
padding: 1em; padding: 1em;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
transition: background-color 200ms ease-out;
} }
a.list-row:hover a.list-row:hover
{ {
@ -503,6 +532,26 @@ img.icon
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
} }
/* Social bar */
.htk-social-bar
{
text-align: center;
}
.htk-social-bar a
{
display: inline-block;
margin: 0 .1em;
}
.htk-social-bar img
{
height: 1.8em;
width: 1.8em;
}
} /*+++++++++ Screen end */
@media screen and (min-width: 1000px) and (max-width: 1399px) @media screen and (min-width: 1000px) and (max-width: 1399px)
{ {
.masonry-box .masonry-box
@ -526,21 +575,3 @@ img.icon
{ {
.masonry-box { width: 25%; } .masonry-box { width: 25%; }
} }
/* Social bar */
.htk-social-bar
{
text-align: center;
}
.htk-social-bar a
{
display: inline-block;
margin: 0 .1em;
}
.htk-social-bar img
{
height: 1.8em;
width: 1.8em;
}

View File

@ -44,7 +44,7 @@ module.exports = new Class
return; return;
this._row = x; this._row = x;
this.iterChanged (); this.changed ();
} }
,get: function () ,get: function ()
{ {
@ -139,7 +139,7 @@ module.exports = new Class
{ {
this._row = row; this._row = row;
this._refreshShowText (); this._refreshShowText ();
this.iterChanged (); this.changed ();
} }
,_onButtonMouseDown: function (e) ,_onButtonMouseDown: function (e)

View File

@ -91,7 +91,7 @@ module.exports = new Class
if (this.clickHandler) if (this.clickHandler)
{ {
Vn.Node.removeClass (this.node, 'clickable'); Vn.Node.removeClass (this.node, 'clickable-img');
this.node.removeEventListener ('click', this.clickHandler); this.node.removeEventListener ('click', this.clickHandler);
this.clickHander = null; this.clickHander = null;
} }
@ -100,7 +100,7 @@ module.exports = new Class
{ {
this.clickHandler = this._onClick.bind (this); this.clickHandler = this._onClick.bind (this);
this.node.addEventListener ('click', this.clickHandler); this.node.addEventListener ('click', this.clickHandler);
Vn.Node.addClass (this.node, 'clickable'); Vn.Node.addClass (this.node, 'clickable-img');
} }
} }

View File

@ -215,7 +215,7 @@ module.exports = new Class
,_onRowUpdate: function (model, row, columns) ,_onRowUpdate: function (model, row, columns)
{ {
this._childsData[row].set.iterChanged (); this._childsData[row].set.changed ();
} }
,_onRowInsert: function (model, row) ,_onRowInsert: function (model, row)

View File

@ -1,4 +1,6 @@
@media screen {
/* Grid */ /* Grid */
.htk-grid .htk-grid
@ -24,10 +26,6 @@
{ {
background-color: rgba(1, 1, 1, 0.2); background-color: rgba(1, 1, 1, 0.2);
} }
.htk-grid tr
{
height: 3.5em;
}
.htk-grid > tfoot a, .htk-grid > tfoot a,
.htk-grid > thead a .htk-grid > thead a
{ {
@ -37,11 +35,12 @@
{ {
background-color: transparent; background-color: transparent;
} }
.htk-grid > tbody tr .htk-grid > tbody > tr
{ {
height: 3.5em;
border-top: 1px solid #DDD; border-top: 1px solid #DDD;
} }
.htk-grid > tbody tr:first-child .htk-grid > tbody > tr:first-child
{ {
border-top: none; border-top: none;
} }
@ -287,11 +286,6 @@ td.cell-image .htk-image
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.htk-image.clickable:hover
{
cursor: pointer;
opacity: 0.85;
}
.htk-image > img .htk-image > img
{ {
display: block; display: block;
@ -637,6 +631,9 @@ td.cell-image .htk-image
border-top-color: white; border-top-color: white;
border-left-color: white; border-left-color: white;
} }
} /*+++++++++ Screen end */
@keyframes spinner @keyframes spinner
{ {
to {transform: rotate(360deg);} to {transform: rotate(360deg);}

View File

@ -7,6 +7,22 @@ module.exports = new Class
Extends: Object Extends: Object
,Implements: Set ,Implements: Set
,Tag: 'vn-basic-set' ,Tag: 'vn-basic-set'
,Properties:
{
params:
{
type: Object
,set: function (x)
{
this._params = x;
this.changed ();
}
,get: function ()
{
return this._params;
}
}
}
,initialize: function (props) ,initialize: function (props)
{ {
@ -14,23 +30,11 @@ module.exports = new Class
this.parent (props); this.parent (props);
} }
/**
* Gets a value from the set.
*
* @param {String} paramName The parameter name
* @return {any} The value
*/
,get: function (paramName) ,get: function (paramName)
{ {
return this._params[paramName]; return this._params[paramName];
} }
/**
* Sets a value on the set.
*
* @param {String} paramName The parameter name
* @param {any} value The new value
*/
,set: function (paramName, value) ,set: function (paramName, value)
{ {
this._params[paramName] = value; this._params[paramName] = value;
@ -45,5 +49,10 @@ module.exports = new Class
this._params = {}; this._params = {};
this.changed (); this.changed ();
} }
,keys: function ()
{
return Object.keys (this._params);
}
}); });

View File

@ -79,47 +79,12 @@ module.exports = new Class
this._onHashChange (); this._onHashChange ();
} }
,parseHashValue: function (v, type)
{
if (v === '')
return null;
if (type && v !== undefined && v !== null)
switch (type)
{
case Boolean:
return (/^(true|1)$/i).test (v);
case Number:
return 0 + new Number (v);
case Date:
return new Date(v);
}
return v;
}
,renderHashValue: function (v)
{
switch (typeof v)
{
case 'number':
return v;
case 'boolean':
return (v) ? 'true' : 'false';
case 'object':
if (v instanceof Date)
return VnDate.strftime (v, '%Y-%m-%d');
}
return v;
}
,_onHashChange: function () ,_onHashChange: function ()
{ {
if (this._hashLock || !this._key || !this._listener) if (this._hashLock || !this._key || !this._listener)
return; return;
var newValue = this.parseHashValue (Hash.get (this._key), this._type); var newValue = Hash.get (this._key, this._type);
this._hashLock = true; this._hashLock = true;
this._setValue (newValue, true); this._setValue (newValue, true);
@ -138,7 +103,7 @@ module.exports = new Class
this._hashLock = true; this._hashLock = true;
var map = {}; var map = {};
map[this._key] = this.renderHashValue(newValue); map[this._key] = newValue;
Hash.add (map); Hash.add (map);
this._hashLock = false; this._hashLock = false;

View File

@ -1,5 +1,6 @@
var HashListener = require ('./hash-listener'); var HashListener = require ('./hash-listener');
var VnDate = require ('./date');
/** /**
* Class to handle the URL. * Class to handle the URL.
@ -34,9 +35,9 @@ module.exports =
* *
* @param {string} key The variable name * @param {string} key The variable name
*/ */
,get: function (key) ,get: function (key, type)
{ {
return this._hashMap[key]; return this.parseValue (this._hashMap[key], type);
} }
/** /**
@ -105,7 +106,7 @@ module.exports =
if (hash.length > 2) if (hash.length > 2)
hash += '&'; hash += '&';
hash += key +'='+ map[key]; hash += key +'='+ this.renderValue (map[key]);
} }
return hash; return hash;
@ -133,4 +134,41 @@ module.exports =
this._hash = newHash; this._hash = newHash;
this._listener.changed (); this._listener.changed ();
} }
,renderValue: function (v)
{
switch (typeof v)
{
case 'number':
return v;
case 'boolean':
return (v) ? 'true' : 'false';
case 'object':
if (v instanceof Date)
return VnDate.strftime (v, '%Y-%m-%d');
}
return v;
}
,parseValue: function (v, type)
{
if (v === '')
return null;
if (type && v !== undefined && v !== null)
switch (type)
{
case Boolean:
return (/^(true|1)$/i).test (v);
case Number:
return 0 + new Number (v);
case Date:
var date = new Date (v);
date.setHours (0, 0, 0, 0);
return date;
}
return v;
}
}; };

View File

@ -1,21 +1,39 @@
module.exports = new Class module.exports = new Class
({ ({
Properties:
{
/**
* The internal object with the params.
*/
params:
{
type: Object
}
}
/** /**
* Gets a value from the set. * Gets a value from the set.
* *
* @param {String} field The field name * @param {String} field The field name
* @return {any} The field value * @return {*} The field value
*/ */
get: function (field) {} ,get: function () {}
/** /**
* Sets a value on the set. * Sets a value on the set.
* *
* @param {String} field The field name * @param {String} field The field name
* @param {any} value The new field value * @param {*} value The new field value
*/ */
,set: function (field, value) {} ,set: function () {}
/**
* Returns an array with the set keys.
*
* @return {Array} The set keys
*/
,keys: function () {}
/** /**
* Emits the 'change' signal on the set. * Emits the 'change' signal on the set.
@ -24,5 +42,22 @@ module.exports = new Class
{ {
this.signalEmit ('change'); this.signalEmit ('change');
} }
/**
* Copies all values from another set.
*
* @param {Set} source The source set
*/
,assign: function (source, keys)
{
if (!keys)
keys = source.keys ();
for (var i = 0; i < keys.length; i++)
{
var key = keys[i];
this.set (key, source.get (key));
}
}
}); });

View File

@ -1,5 +1,4 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

View File

@ -1,5 +1,4 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

View File

@ -1,33 +1,26 @@
*
{ .report .sheet
font-size: 4mm;
}
.sheet
{ {
height: auto; height: auto;
} }
h2 .report h2
{ {
font-size: 1.2em; margin-bottom: .8em;
margin-bottom: 8mm;
font-weight: bold; font-weight: bold;
} }
.header .report .header
{ {
margin-bottom: 2em; margin-bottom: 2em;
} }
.header > p .report .header > p
{ {
text-align: right; text-align: right;
margin: .1em 0; margin: .1em 0;
} }
.footer .report .footer
{ {
font-size: 1.2em;
font-weight: bold; font-weight: bold;
margin-top: .2em;
border-top: 1px solid #333; border-top: 1px solid #333;
padding-top: .3em; padding-top: .3em;
text-align: right; text-align: right;
} }

View File

@ -42,6 +42,7 @@
<htk-column-text title="_Item" column="concept"/> <htk-column-text title="_Item" column="concept"/>
<htk-column-text title="_S1" column="Medida"/> <htk-column-text title="_S1" column="Medida"/>
<htk-column-text title="_Cat" column="Categoria"/> <htk-column-text title="_Cat" column="Categoria"/>
<htk-column-text title="_Color" column="Color"/>
<htk-column-spin title="_Price" column="price" unit="€" digits="2"/> <htk-column-spin title="_Price" column="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>

View File

@ -1,45 +1,42 @@
*
{ .report .sheet
font-size: 4mm;
}
.sheet
{ {
height: auto; height: auto;
} }
h1 .report h1
{ {
font-weight: normal; font-weight: normal;
font-size: 200%; font-size: 4em;
text-align: center; text-align: center;
margin: 0 auto; margin: 0 auto;
margin-bottom: 8mm; margin-bottom: .8em;
} }
.htk-grid .report .htk-grid
{ {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
padding: 0; padding: 0;
} }
thead > tr .report thead > tr
{ {
border-bottom: 1px solid #333; border-bottom: 1px solid #333;
height: 10mm; height: .1em;
} }
th .report th
{ {
font-weight: normal; font-weight: normal;
} }
td .report td
{ {
padding-left: 2mm; padding-left: .02em;
} }
tbody > tr .report tbody > tr
{ {
height: 18mm; height: .18em;
} }
.cell-image > img .report .cell-image > img
{ {
width: 15mm; width: .15em;
} }

View File

@ -8,9 +8,8 @@ Hedera.ShelvesReport = new Class
,trayThickness: 2 ,trayThickness: 2
,trayMargin: 5 ,trayMargin: 5
,open: function (batch) ,activate: function (batch)
{ {
this.batch = batch;
this.title = batch.getValue ('reportTitle'); this.title = batch.getValue ('reportTitle');
this.maxAmount = batch.getValue ('maxAmount'); this.maxAmount = batch.getValue ('maxAmount');
this.showPacking = batch.getValue ('showPacking'); this.showPacking = batch.getValue ('showPacking');
@ -108,10 +107,10 @@ Hedera.ShelvesReport = new Class
// Opens the report // Opens the report
this.createWindow (); this.renderReport ();
} }
,onWindowCreate: function () ,renderReport: function ()
{ {
// Remaining amount // Remaining amount
@ -120,8 +119,8 @@ Hedera.ShelvesReport = new Class
if (remainings.length > 0) if (remainings.length > 0)
{ {
var sheet = this.doc.createElement ('div'); var sheet = this.doc.createElement ('div');
sheet.className = 'sheet'; sheet.className = 'sheet remaining';
this.doc.body.appendChild (sheet); this.body.appendChild (sheet);
var title = this.doc.createElement ('h1'); var title = this.doc.createElement ('h1');
title.className = 'title'; title.className = 'title';
@ -133,20 +132,20 @@ Hedera.ShelvesReport = new Class
subtitle.appendChild (this.doc.createTextNode (_('Pallets'))); subtitle.appendChild (this.doc.createTextNode (_('Pallets')));
sheet.appendChild (subtitle); sheet.appendChild (subtitle);
var ul = this.doc.createElement ('ul'); var ul = this.doc.createElement ('table');
sheet.appendChild (ul); sheet.appendChild (ul);
for (var i = 0; i < remainings.length; i++) for (var i = 0; i < remainings.length; i++)
{ {
var li = this.doc.createElement ('li'); var li = this.doc.createElement ('tr');
ul.appendChild (li); ul.appendChild (li);
var span = this.doc.createElement ('span'); var span = this.doc.createElement ('td');
span.className = 'item-id'; span.className = 'item-id';
span.appendChild (this.doc.createTextNode (remainings[i].id.toLocaleString ())); span.appendChild (this.doc.createTextNode (remainings[i].id.toLocaleString ()));
li.appendChild (span); li.appendChild (span);
var span = this.doc.createElement ('span'); var span = this.doc.createElement ('td');
span.className = 'item'; span.className = 'item';
span.appendChild (this.doc.createTextNode (remainings[i].name)); span.appendChild (this.doc.createTextNode (remainings[i].name));
li.appendChild (span); li.appendChild (span);
@ -154,7 +153,7 @@ Hedera.ShelvesReport = new Class
if (this.showPacking) if (this.showPacking)
span.appendChild (this.doc.createTextNode (' '+ remainings[i].packing)); span.appendChild (this.doc.createTextNode (' '+ remainings[i].packing));
var span = this.doc.createElement ('span'); var span = this.doc.createElement ('td');
span.className = 'amount'; span.className = 'amount';
span.appendChild (this.doc.createTextNode (remainings[i].amount)); span.appendChild (this.doc.createTextNode (remainings[i].amount));
li.appendChild (span); li.appendChild (span);
@ -173,7 +172,7 @@ Hedera.ShelvesReport = new Class
var sheet = this.doc.createElement ('div'); var sheet = this.doc.createElement ('div');
sheet.className = 'sheet'; sheet.className = 'sheet';
this.doc.body.appendChild (sheet); this.body.appendChild (sheet);
// Draws the title // Draws the title
@ -249,7 +248,8 @@ Hedera.ShelvesReport = new Class
,mm: function (size) ,mm: function (size)
{ {
return size.toFixed (2) +'mm'; size *= 0.24;
return size.toFixed (2) +'em';
} }
,drawBox: function (allocator, item, amount) ,drawBox: function (allocator, item, amount)

View File

@ -1,7 +1,12 @@
.report .sheet.remaining
{
height: auto;
}
/* Shelves */ /* Shelves */
h1 .report h1
{ {
font-weight: normal; font-weight: normal;
font-size: 500%; font-size: 500%;
@ -9,110 +14,110 @@ h1
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
margin-bottom: 4mm; margin-bottom: .4em;
} }
label.range-label .report label.range-label
{ {
color: #777; color: #777;
} }
h2.subtitle .report h2.subtitle
{ {
margin: 0; margin: 0;
font-size: 200%; font-size: 200%;
margin-bottom: 2mm; margin-bottom: .2em;
font-weight: normal; font-weight: normal;
color: #333; color: #333;
} }
h1.page-number .report h1.page-number
{ {
padding-left: 4mm; padding-left: .4em;
float: right; float: right;
text-align: right; text-align: right;
} }
.shelf .report .shelf
{ {
position: relative; position: relative;
margin: 0 auto; margin: 0 auto;
padding-top: 10mm; padding-top: 1em;
} }
.edge, .report .edge,
.tray .report .tray
{ {
position: absolute; position: absolute;
border-top: 2px solid black; border-top: 2px solid black;
box-sizing: border-box; box-sizing: border-box;
} }
.edge .report .edge
{ {
width: 0; width: 0;
} }
.box .report .box
{ {
position: absolute; position: absolute;
border: 1px solid black; border: 1px solid black;
border-bottom: 0; border-bottom: 0;
box-sizing: border-box; box-sizing: border-box;
} }
.box-label .report .box-label
{ {
font-size: 2.55mm; font-size: .25em;
word-wrap: break-word; word-wrap: break-word;
box-sizing: border-box; box-sizing: border-box;
padding: 1% 2%; padding: 1% 2%;
} }
.box-label.id .report .box-label.id
{ {
text-align: right; text-align: right;
} }
.color0 .report .color0
{ {
background-color: #FDD !important; background-color: #FDD !important;
} }
.color1 .report .color1
{ {
background-color: #DFD !important; background-color: #DFD !important;
} }
.color2 .report .color2
{ {
background-color: #DDF !important; background-color: #DDF !important;
} }
.color3 .report .color3
{ {
background-color: #DFF !important; background-color: #DFF !important;
} }
.color4 .report .color4
{ {
background-color: #FFD !important; background-color: #FFD !important;
} }
/* Remaining amounts*/ /* Remaining amounts*/
ul .report table
{ {
list-style-type: none; list-style-type: none;
padding-left: .5em;
} }
li * .report table td
{ {
font-size: 200%; font-size: 2em;
line-height: 200%; padding: .2em .5em;
} }
.item-id .report .item-id
{ {
display: inline-block;
text-align: right; text-align: right;
margin: 0 5mm; width: 1em;
width: 30mm;
} }
.item .report .item
{ {
display: inline-block; max-width: 10em;
width: 80mm; text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
} }
.amount .report .amount
{ {
text-align: right;
width: 1em;
color: #666; color: #666;
width: 10mm;
text-align: right;
padding-right: 1mm;
} }